unable to connect to a remote pc

New to Debian (Or Linux in general)? Ask your questions here!

unable to connect to a remote pc

Postby codefish » 2017-03-19 07:49

I'm trying to ssh from my laptop that runs archilnux to my pc with newly installed Debian. Physically the pc is located in another room so it's safe to say it's within the same local network as my laptop.
In order to do it I issue the following command:

Code: Select all
# hostname -I


and get the private ip of the remote server which is 192.168.1.3.

Then I try to establish a ssh connection as follows:

Code: Select all
# ssh chris@192.168.1.3


This yields the WARNING:

Code: Select all
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:ky5yWZFqIAGYSVrWWJFGviem0S3OUogjVlyyAUTxeHs.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
ECDSA host key for 192.168.1.3 has changed and you have requested strict checking.
Host key verification failed.


Before asking this question on the forum I'd done some searching on the internet and eventually followed one of the solutions I found suggesting that I should remove the offending ECDSA key with
Code: Select all
# sed -i '1d' ~/.ssh/known_hosts


I'm not sure if that was the right thing to do though cos the problem persisted... I mean I'm still getting the same warning about me being potentially man-in-the-middled but the ~/.ssh/known_hosts file is now empty.
I'm not sure what to do next since I don't quite understand what is causing this issue :cry: I'm supposed to add correct host key to the file but what I'd like to understand first is how come the issue is still there after I removed the key and the '~/.ssh/known_hosts' file appears to be empty.

Any advice would be greately appreciated.

Thank you.
codefish
 
Posts: 1
Joined: 2017-03-19 07:12

Re: unable to connect to a remote pc

Postby Hallvor » 2017-03-19 09:36

Try

Code: Select all
# ssh-keygen -R 192.168.1.3


This should remove the key.
Laptop: Intel Core i5 3210-M CPU @ 2.50 GHz, 16 GB RAM, Intel HD 4000 graphics, 128 GB SSD + 1 TB HDD, Debian Jessie (KDE)
Laptop 2: Intel Core i5 3320-M CPU @ 2.60 GHz, 6 GB RAM, Intel HD 4000 graphics, 300 GB HDD, Debian Jessie (KDE)
User avatar
Hallvor
 
Posts: 693
Joined: 2009-04-16 18:35
Location: Norway

Re: unable to connect to a remote pc

Postby debiman » 2017-03-21 07:27

you never mentioned you actually set up key identification, but i guess the error message kindof proves that.
i think hallvor is right; i've recently seen a very similar topic.

in any case:
https://wiki.archlinux.org/index.php/Using_SSH_Keys
but i guess you knew that already.
can't hurt though.
User avatar
debiman
 
Posts: 974
Joined: 2013-03-12 07:18


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable