漏洞掃描有SSH 服務支援弱加密算法,解決方案有兩個:
方案一:修改 SSH 配置檔案,添加加密算法:
vi /etc/ssh/sshd_config
最後添加一下内容(去掉 arcfour、arcfour128、arcfour256 等弱加密算法)
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc
儲存檔案後重新開機 SSH 服務:service sshd restart
方案二:更新 openssh 版本為最新版本
官網有說明,OpenSSH 7.0 以後的版本預設禁用了一些較低版本的密鑰算法。
SSH Weak MAC Algorithms Enabled 漏洞修複使用同樣的方式,添加以下行:
MACs hmac-sha1,umac-64,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160
參考連結:
https://linux.uits.uconn.edu/2014/06/25/ssh-weak-ciphers-and-mac-algorithms/#
這裡使用方案一進行:
操作步驟:
vim /etc/ssh/sshd_config
但是重新開機ssh報錯:
-- Unit sshd.service has begun starting up.
Feb 20 15:57:24 VM-24-9-centos sshd[27215]: /etc/ssh/sshd_config line 144: Bad SSH2 cipher spec 'aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes25-cbc'.
Feb 20 15:57:24 VM-24-9-centos systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Feb 20 15:57:24 VM-24-9-centos systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: Unit sshd.service has failed
通過指令:
sshd -t
檢視到 有不支援的加密算法
然後通過:
ssh -Q cipher
檢視支援的cipher清單,然後将清單中的内容排除掉漏洞中的弱加密清單