為了盡可能減少惡意攻擊,請維護虛擬應用裝置主機上的關鍵 SSH 金鑰檔案權限。
程序
- 透過執行以下命令檢查 SSH 公開金鑰檔案:#ls -al /etc/ssh/*pub
- 確認檔案具有下列權限。
-rw-r--r-- 1 root root 609 date and time /etc/ssh/ssh_host_dsa_key.pub -rw-r--r-- 1 root root 181 date and time /etc/ssh/ssh_host_ecdsa_key.pub -rw-r--r-- 1 root root 101 date and time /etc/ssh/ssh_host_ed25519_key.pub -rw-r--r-- 1 root root 401 date and time /etc/ssh/ssh_host_rsa_key.pub
- 透過執行以下命令檢查 SSH 私密金鑰檔案:ls -al /etc/ssh/*key
- 確認檔案具有下列權限。
-rw------- 1 root root 668 date and time /etc/ssh/ssh_host_dsa_key -rw------- 1 root root 227 date and time /etc/ssh/ssh_host_ecdsa_key -rw------- 1 root root 411 date and time /etc/ssh/ssh_host_ed25519_key -rw------- 1 root root 1679 date and time /etc/ssh/ssh_host_rsa_key
- 執行以下命令來檢查 SSH 組態檔:#lls -al /etc/ssh/*config
- 確認檔案具有下列權限。
-rw-r--r-- 1 root root 1914 date and time /etc/ssh/ssh_config -rw------- 1 root root 3481 date and time /etc/ssh/sshd_config