使用sshd執行時,顯示缺失key等
使用ssh-keygen生成。
例如:如果缺失rsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
其中/etc/ssh/ssh_host_rsa_key
根據提示填寫
使用sshd時遇到Could not load host key
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
這種情況一般是權限問題,因爲could not load說明已經有這些key而不能加載,所以查看key的權限組。
一般來說這些key時root權限組的,而你使用的普通用戶所以加載失敗,解決方法:
sudo /usr/sbin/sshd