1. 程式人生 > 其它 >CentOS Linux release 7.5.1804 (Core) OpenSSH8.0升級OpenSSH9.0

CentOS Linux release 7.5.1804 (Core) OpenSSH8.0升級OpenSSH9.0

ssh -V 檢視版本

cd /usr/local/src

1.下載檔案:
wget "https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz

wget "ttp://www.openssl.org/source/openssh-9.0p1.tar.gz "

2、解壓
tar -zvxf openssh-9.0p1.tar.gz
3、進入
cd openssh-9.0p1/
4.停止服務:
systemctl stop sshd
5.刪除歷史檔案:
yum remove openssh -y
6.安裝依賴:
yum install gcc openssl-devel zlib-devel
7.執行安裝
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords--with-pam --with-tcp-wrappers --with-ssl-dir=/usr/bin/openssl --without-hardening
8.
make
9.
make install
10.刪除報錯提示的key檔案

rm -rf /etc/ssh/ssh_host_rsa_key
rm -rf /etc/ssh/ssh_host_ecdsa_key
rm -rf /etc/ssh/ssh_host_ed25519_key

11.修改/etc/ssh/sshd_config配置檔案 (此步驟可以跳過)
vim /etc/ssh/sshd_config
PermitRootLogin yes #允許root登入
#PermitRootLogin prohibit-password

12.cp contrib/redhat/sshd.init /etc/init.d/sshd
13.chkconfig --add sshd
14.chkconfig sshd on
15.chkconfig --list|grep sshd

16.service sshd start
17.ssh -V

 如果提示

 升級Xhell版本Xhell7