How to add/delete host keys

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add/delete host keys

L2 Linker

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

1 accepted solution

Accepted Solutions

L5 Sessionator

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

View solution in original post

2 REPLIES 2

L5 Sessionator

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

L0 Member

Either the cmd @nrice gave nearly 15 years ago is wrong or it's just an old cmd, but it's close still. So no blame just an update.

This is to delete all known_hosts for your current login

delete authentication user-file ssh-known-hosts self

This is to delete a specific IP address from a specific users known_hosts file.

delete authentication user-file ssh-known-hosts user ip <ip address> username <user name>

  • 1 accepted solution
  • 9480 Views
  • 2 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!