billybob01
Posts: 7
Joined: Fri Jun 01, 2012 4:28 pm

SSH login refused from Linux PC

Fri Jun 01, 2012 4:33 pm

I have XBMC running on a PI at last and have been SSHing from a windows PC just fine.
I tried to SSH from a laptop running Puppy Linux and I get a warning message that the Remote Host Identification has changed.

The message tells me I have to change the SSH key in a directory that doesn't exist. I found a debian instruction somewhere telling me to delete the SSH files that hold the keys and regenerate the keys. I couldn't even delete the files.

Can anyone tell me how to SSH in from the Puppy machine?

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: SSH login refused from Linux PC

Fri Jun 01, 2012 8:09 pm

Are you specifying an IP address with your ssh or a host name?

If an address could you have ssh'd onto a machine in the past with the same IP address that your pi now has?

If a name could you have ssh'd onto a machine (or VM) with the same name?

You will have to alter the known_hosts file on your Linux PC. Login and change directory to .ssh
edit known_hosts and remove the offending line.

snaipperi
Posts: 16
Joined: Fri Dec 02, 2011 10:37 am

Re: SSH login refused from Linux PC

Sat Jun 02, 2012 12:11 pm

Use something like

Code: Select all

ssh-keygen -R 192.168.1.5
where 192.168.1.5 is the host you're trying to connect to. Replace as necessary. the -R switch stands for remove. The defined host is removed from your known_hosts file.

Alternatively like andyl said, you need to manually remove the offending line in ~/.ssh/known_hosts file. "~" is a shortcut for your home directory.

The error is caused when there is a different system running behind the same host you've connected to before. You can cause this situation for example when re-installing the base system or regenerating new SSH key pairs. This security measure exists to make sure that you don't accidentally connect to a "wrong machine", potentially exposing your security credentials to an unknown party. (Correct me if I'm wrong!)

billybob01
Posts: 7
Joined: Fri Jun 01, 2012 4:28 pm

Re: SSH login refused from Linux PC

Sat Jun 02, 2012 2:39 pm

Ah thankyou both so much.
The problem occurred after I SSH'd onto the PI with a different SD card. Because I couldn't get my wifi adapter working under Raspbmc I switched to a straight debian image and couldn't SSH in.
I was trying to change the known hosts on the PI. I didn't realise I was supposed to be doing it from the Linux PC.
Your -R command worked beautifully and I am now up and running. XBMC is working like a dream.

TyNick
Posts: 1
Joined: Fri Sep 14, 2012 1:49 am

Re: SSH login refused from Linux PC

Fri Sep 14, 2012 1:51 am

Just wanted to say thanks, this post/answer helped me out.

PatrikJarl
Posts: 1
Joined: Thu Nov 28, 2013 1:48 pm

Re: SSH login refused from Linux PC

Thu Nov 28, 2013 1:50 pm

Awsome! This was my final step to connect to my RaspPi headless for the first time! Txs for sharing guys!

wdihtcai
Posts: 1
Joined: Mon Nov 17, 2014 12:21 pm

Re: SSH login refused from Linux PC

Wed Nov 19, 2014 12:38 am

A great post. I encountered the message " WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" when I booted up weezy-raspian from a new micro-sd card. Your suggestion:
ssh-keygen -R "netaddress" (10.0.1.7 in my case) worked perfectly. I was able to ssh into my raspberry PI as before.
THANKS!

-Theush-
Posts: 1
Joined: Thu Aug 06, 2015 6:29 pm

Re: SSH login refused from Linux PC

Thu Aug 06, 2015 6:34 pm

Thanks for this post/answers!! Keep up the good work!

Return to “Beginners”