How to add/delete host keys

Reply
Highlighted
L2 Linker

How to add/delete host keys

Hello,

I was testing out different SCP servers to export logs from the PA firewall, but I got this message after my third SCP server:

<user>@PA2050> scp export logdb to <user>@10.200.168.158:logdb
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
7f:95:fd:7e:e6:99:53:c4:40:6b:c8:80:28:01:dc:e5.
Please contact your system administrator.
Add correct host key in /home/admin/.ssh/known_hosts to get rid of this message.
Offending key in /home/admin/.ssh/known_hosts:2
RSA host key for 10.200.168.158 has changed and you have requested strict checking.
Host key verification failed.

Can you delete the old keys, since they won't be used again?

and how would you add new host keys if you needed too?

Thanks

Tags (1)
L5 Sessionator

Re: How to add/delete host keys

The option to remove the key is >delete user-file ssh-known-hosts.  The new key would be generated when establishing a new connection.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!