CHTJonas

regenerate host keys

Mar 7th, 2020
172
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sudo rm -v /etc/ssh/ssh_host_*
  2. sudo dpkg-reconfigure openssh-server
  3. sudo systemctl restart sshd
  4.  
  5. ssh-keygen -r $(hostname -f)
  6.  
  7. for pubkey_file in /etc/ssh/*.pub; do
  8.   ssh-keygen -l -E md5 -f ${pubkey_file};
  9.   ssh-keygen -l -E sha256 -f ${pubkey_file};
  10. done
RAW Paste Data