Old [email protected]:0 etc/ssh ssh secrethost The authenticity of host 'secrethost can't be established.
The fingerprint for the RSA hosts key sent by the remote host is Please contact your system administrator.
Small lesson learned about sed.Add correct host key in /root/.ssh/known_hosts hosts to get remove rid of this message.Therefore I remove browsed keygen through the man pages and finally keygen found what I select was looking for in man ssh-keygen.It is also possible that the RSA host key has just been changed.Sed k 'xd' /.ssh/known_hosts.There is the setting StrictHostKeyChecking that might get you out of the but it does not solve the real problem as you want those checks.Unless I'm misunderstanding, you lost your.ssh directory containing keygen your private key on your local machine and so you want to remove the public key which was on a server and which allowed key-based login.
RSA key fingerprint is Are you facial sure you want to continue connecting (yes/no)?
So after hanging around with, poems mnemonikk discussing this he pointed out a vision very simple method with sed that is really handy and helps you understanding sed more deeply.
Offending key in barbie /root/.ssh/known_hosts:1 RSA host key for has changed and you have requested strict checking.
I randomly checked man ssh which gives you a lot of hints about the select usage of known_hosts but I just did not find information about how to delete an old fingerprint or even overwrite.
I then rebuild stories it from scratch, getting a new host fingerprint and I try to reconnect, I will get a warning that there is a conflict on line X (say 3).You can advise sed to run a command on a specific line.I stories hope that key wasn't your only method of access to the server and you have some other way of logging in and editing the file.Using ssh-keygen -R hostname will not always work.Using ssh-keygen does this automatically.So have a look at this session: ssh secrethost @ warning: remote host identification HAS changed!In this case the only way to successfully get the offending host removed was to use sed -i 'xd' /.ssh/known_hosts, to take this sed one step further, you may wish to make a backup of the known_hosts in case you delete the wrong line,[email protected] iT IS possible that someone IS doing short something nasty!At least from the last issue in Debian-based systems including Ubuntu you might know the pain of getting the message from you ssh client that the server host key has changed as ssh stores the fingerprint of ssh daemons it connects.For example, I have a host called build-node-01 and I have connected to it and accepted the key.Someone could be eavesdropping on you right now (man-in-the-middle attack)!Either way, you'll need password auth set up for your account on the server, or some other identity or access method to get to the authorized_keys file on the server.If you have a newer version of SSH that is "hiding" the hostnames to prevent ssh-agent hijacking, apparently ssh-keygen is unable to unhash the hostname.Actually this is a neat feature because it helps you detecting man in the middle attacks, dns issues and other things you probably should notice.
So ssh-keygen -R hostname is a nice syntax as you even do not have to provide the file name and path for known_hosts and it works with ssh keygen select hosts remove hashed names.
The authenticity of host 'secrethost can't be established.
We just took the line number 46 which ssh complains about and run in in-place-editing mode (-i) with the command run on line 46 the command delete (d).