Read more at https://itso.iu.edu/Hashing_the_OpenSSH_known__hosts_File.
To hash every user's known_hosts files and delete the known_hosts.old:
for username in `cut -f 1 -d : /etc/passwd`; do echo $username; sudo -u $username ssh-keygen -H; rm `sh -c "echo ~$username/.ssh/known_hosts.old"`; done
No comments:
Post a Comment