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

Then I try to establish a ssh connection as follows:

Code: Select all
# ssh chris@

This yields the WARNING:

Code: Select all
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
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 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.
Posts: 1
Joined: 2017-03-19 07:12

Re: unable to connect to a remote pc

Postby Hallvor » 2017-03-19 09:36


Code: Select all
# ssh-keygen -R

This should remove the key.
Intel Core i5 3320-M CPU @ 2.60 GHz, 6 GB RAM, Intel HD 4000 graphics, 240 GB SSD, Debian Stretch (KDE)
User avatar
Posts: 804
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:
but i guess you knew that already.
can't hurt though.
User avatar
Posts: 2209
Joined: 2013-03-12 07:18

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 3 guests