目錄
目錄X
銀河麒麟 OpenSSH 10.0p1(aarch64)安裝升級(jí)完整步驟
說明
適用于:
?? 麒麟/Kylin、openEuler、CentOS/RHEL
?? aarch64 系統(tǒng)
?? 從 openssh 8.x 升級(jí)到 openssh 10.x,用于修復(fù)安全軟件檢測(cè)的openssh漏洞問題
1. 解壓 tar 包
cd /opt tar -xvf linux.openssh10.0p1.arm.tarcd aarch64
2. 卸載沖突包 openssh-help
rpm -e --nodeps openssh-help
說明:openssh-help 是文檔包,不影響運(yùn)行,但升級(jí)時(shí)會(huì)沖突,因此先卸載。
3. 安裝 OpenSSH 10.0p1 RPM
rpm -Uvh openssh-10.0p1-1.el8.aarch64.rpm \ openssh-clients-10.0p1-1.el8.aarch64.rpm \ openssh-server-10.0p1-1.el8.aarch64.rpm
?? rpm -Uvh 會(huì)自動(dòng)覆蓋舊版本
?? 升級(jí)期間不會(huì)影響現(xiàn)有 config 文件
4. 修改 SSH 配置文件
編輯文件:
vim /etc/ssh/sshd_config
找到下面三項(xiàng):
RSAAuthentication RhostsRSAAuthentication GSSAPIKexAlgorithms
并注釋掉它們:
# RSAAuthentication # RhostsRSAAuthentication # GSSAPIKexAlgorithms
?? 為什么要注釋?
在 OpenSSH 10 中,這些參數(shù):
| 參數(shù) | 狀態(tài) |
|---|---|
| RSAAuthentication | 已廢棄 |
| RhostsRSAAuthentication | 已廢棄 |
| GSSAPIKexAlgorithms | 不再支持 |
不注釋會(huì)導(dǎo)致:
/etc/ssh/sshd_config: bad configuration option
并使 sshd 無法啟動(dòng)。
5. 檢查 sshd 配置是否正確
sshd -t
輸出為空 = 正常
6. 重啟 SSH 服務(wù)
systemctl restart sshd
查看狀態(tài):
systemctl status sshd
預(yù)期輸出為 active (running)
7. 查看偵聽端口
netstat -lntp | grep sshd
示例:
tcp 0 0 0.0.0.0:1022 ... LISTEN
8. 查看 OpenSSH 版本(驗(yàn)證成功)
/usr/sbin/sshd -V
輸出:
OpenSSH_10.0p1 ...
9. 讓 sshd 開機(jī)自啟
systemctl enable sshd