Generating new ssh server keys
From PeTechWiki
Jump to navigationJump to search
Reference: How to regenerate new ssh server keys - XWiki
If you clone an existing server setup to create a new server, you'll probably want to generate a new set of keys for the new ssh server.
For SSH1 protocol, you need an rsa1 key:
ssh-keygen -q -f /etc/ssh/ssh_host_key -N -t rsa1
For SSH2 protocol, you need two keys, one rsa key and one dsa key:
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N -t rsa ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N -t dsa