Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

unable to connect to a remote pc

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
codefish
Posts: 1
Joined: 2017-03-19 07:12

unable to connect to a remote pc

#1 Post by codefish »

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.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2041
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 149 times
Been thanked: 212 times

Re: unable to connect to a remote pc

#2 Post by Hallvor »

Try

Code: Select all

# ssh-keygen -R 192.168.1.3
This should remove the key.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: unable to connect to a remote pc

#3 Post by debiman »

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.

Post Reply