sshd執行時遇到的一些問題(缺失密鑰、could not load host key等)

使用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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章