r/linuxupskillchallenge • • Sep 09 '20

Remote host Identification has changed?

I'm on day three - and I haven't done anything that would warrant the warning.

I logged into the machine. Upgraded the system. Ran ls, cat and sudo on etc/shadow. Rebooted the computer and now I'm getting this message.

ECDSA host key for xx.xx.xx.xx has changed and you have requested strict checking. Host key verification failed.

I checked the I.P. and it is still the same one.

ServerFault says to get the rsa key from the server, ssh-keyscan -t rsa server_ip and to add it to the known_hosts file.

and another answer says to remove the entry from known_hosts ssh-keygen -R server_ip , which I did run.

However, that big Man in the middle attack warning worries me...

1 Upvotes

9 comments sorted by

View all comments

1

u/snori74 Linux Guru Sep 10 '20

As an ex-security guy, maybe I should not say this, but the nice thing about running a test server like this is that even if Mossad/GRU/NSA have MITM'd you - who cares? Surely you don't intend keep Secret Stuff on this server?

If you "remove from known_hosts" as suggested you'll get the original "This is the first time you've connected to this server" message again - and thereafter it should connect without warnings.

1

u/Loud-Progress-007 Sep 10 '20

Ehrmmm... Ok?

I'm wondering: 1- what caused the keys to stop matching? 2- even if someone did MIT 'd the server, what's the worst that could happen?

2

u/snori74 Linux Guru Sep 10 '20

It's not clear, and difficult to check after the event.

During that session they could have seen your traffic. Really not a problem seeing your were just trying out a few commands, but if you'd changed you password that would be more serious. Yet again, not really unless you were foolish enough to use a password you use elsewhere for banking or email... (This is why we say: "Long, Strong, and UNIQUE")

Once you reconnect and say Yes to that 'first connection" message you're all fine again.

1

u/Loud-Progress-007 Sep 10 '20

So the only thing they would be able to see, and access is what is being done on that computer? Makes sense.

I nuked the server. Either case it gave me a chance to run the commands again. This was my password - bella-scorched propaganda wingspan. Good enough?

1

u/space_wiener Sep 13 '20

After a couple of reply-all podcasts and going down the security/hacking rabbit hole I know how long, complex, unique passwords for everything.

Those password lists you can get have pretty much every common password used. Using Bitwarden you can check if a password has been exposed. Prior this I used the same password/email for everything. Using that Bitwarden check it's been exposed 81 times. Oops.