这是我生成的密钥,ssh
不是我创建的。
# ls -l /etc/ssh/
total 276
-rw-r--r-- 1 root root 242153 Mar 22 2016 moduli
-rw-r--r-- 1 root root 2208 Mar 22 2016 ssh_config
-rw-r--r-- 1 root root 4360 Feb 29 2016 sshd_config
-rw-r-----. 1 root ssh_keys 227 Mar 5 2015 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 162 Mar 5 2015 ssh_host_ecdsa_key.pub
-rw-r----- 1 root ssh_keys 387 Apr 8 2015 ssh_host_ed25519_key
-rw-r--r-- 1 root root 82 Apr 8 2015 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys 1679 Mar 5 2015 ssh_host_rsa_key
-rw-r--r--. 1 root root 382 Mar 5 2015 ssh_host_rsa_key.pub
具有这些密钥的服务器是Vagrant实例。我有几个实例,但是不幸的是每个实例都具有相同的键。因此,我需要重新生成所有密钥以区分每个服务器。
如何重新生成这些密钥?
删除旧密钥,然后运行:
ssh-keygen -A restorecon / etc / ssh / ssh_host_ *
注意:moduli
和(显然)sshd_config
不是键,因此不应将其删除。
主机密钥也可以使用以下命令一一生成:
for type in rsa dsa ecdsa ed25519; do
ssh-keygen -t ${type} -N "" -f /etc/ssh/ssh_host_${type}_key
done
restorecon /etc/ssh/ssh_host_*
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句