# SSH - WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

## Pithlit

Ok... I'm dumb as a dead amoeba... 

I could easily ssh into my desktop during the installation of gentoo... but after rebooting into a fresh install I get:

```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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 the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

e3:45:16:b6:9b:ff:97:5f:93:13:31:ce:f3:59:b3:33.

Please contact your system administrator.

Add correct host key in /root/.ssh/known_hosts to get rid of this message.

Offending key in /root/.ssh/known_hosts:1

RSA host key for 192.168.0.104 has changed and you have requested strict checking.

Host key verification failed.
```

could anyone fix that for me?   :Embarassed: 

----------

## lghman

The RSA key is different from the boot cd and your new installation.  Do what it says and delete the entery for your machine in your /root/.ssh/known_hosts file. Then it will work fine.   :Wink: 

--sonik

----------

## Pithlit

Yes... I can read... I tried that and... I have no such file!   :Shocked:   Maybe it's my desktop that's dumb...

----------

## DopeGhoti

files that start with a dot are 'hidden' files, that will not show up wihtout jumping htrough a hoop or two.  Worry not, though:

Open up a terminal, and run this command:

```
nano -w ~/.ssh/known_hosts
```

and lo and behold, the file shall be opened for editing.

----------

## Pithlit

once again... I HAVE NO SUCH FILE! not hidden not otherwise. I know how to find hidden files... I'm not a linux n00b (well not exactly), I'm a total ssh n00b tho.

----------

## kashani

If you have no such file then you will have no such problem. It stands to reason that you do indeed have the file in question, which is the source of your problem. 

According to your message below you were logged in as root on the client machine. So you'd want to edit this file on the client machine, NOT the server you are trying to connect to.

/root/.ssh/known_hosts

Remove the line with the hostname or IP of the server you were trying to connect to. Save the file and try to ssh in again. Should work fine. 

What happened is the CD runs everything in temp space so the old ssh keys of the server were not saved when you rebooted. It generated new keys which are now saved in /etc/ssh/, but those were obviously different then the old ones.

kashani

----------

## shadow255

 *Pithlit wrote:*   

> Ok... I'm dumb as a dead amoeba... 
> 
> I could easily ssh into my desktop during the installation of gentoo... but after rebooting into a fresh install I get:
> 
> 

 

I've snipped out extraneous verbage from your warning message in the following code snip:

```
Add correct host key in /root/.ssh/known_hosts to get rid of this message.

Offending key in /root/.ssh/known_hosts:1

```

From this message it appears that, as root, you're getting warned that the known_hosts entry for the machine at 192.168.0.104 does not match the existing key.  Have you attempted to ssh to the box as a different user?

Another helpful exercise would be for you to open a console as root and post for us the results of the command 

```
ls -la /root/.ssh
```

It is puzzling that you would receive the warning without the presence of the file as shown in the same warning.

----------

## DopeGhoti

Interesting.  Could you please paste here the output of the following two commands?

```
ls -la /root
```

```
ls -la /root/.ssh/
```

----------

## Pithlit

No pasting since I have no GUI yet   :Razz:   sooo... lemme type this stuff up (the spacing might not be correct)

honey linux # ls -la /root

total 16

drwx------       3 root      root      4096 Jan 23 15:22 .

drwxr-xr-x    17 root      root      4096 Jan 22 19:57 ..

-rw--------       1 root      root      1194 Jan 23 18:05 .bash_history

drwxr-xr-x      2 root      root      4096 Sep 13  03:36 .ccashe

-rw-r--r--         1 root      root           0 Jan 21 20:59 .keep

honey linux # ls -la /root/.ssh

ls: /root/.ssh: No such file or directory

honey linux #

aaaaaaand.... that's about it.

tried unmerging and reemerging openssh with rebooting in between... same shit   :Crying or Very sad: 

----------

## shadow255

 *Pithlit wrote:*   

> No pasting since I have no GUI yet    sooo... lemme type this stuff up (the spacing might not be correct)
> 
> honey linux # ls -la /root
> 
> total 16
> ...

 

Let me ask you another question:  are you looking for /root/.ssh/known_hosts on the 192.168.0.104 box?  If so, that's the cause of all the confusion.  You should be looking for this file on the machine you are attempting to ssh from rather than on the machine you're ssh'ing to.

----------

## Pithlit

now you tell me...   :Embarassed:   told you I was a ssh n00b. NOW... it works. Sorry to have bothered you guys. 

*Pithlit hides under his rock*

----------

## viperlin

i thought this was an exploit warning at first, lol, well you solved it so i guess panics over.

----------

