openssh从5.3或者7 版本升级到9.1版本

操作系统CentOS Linux release 7.9.2009 (Core)
 从OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017 升级到9.1 版本
 操作系统CentOS release 6.7 (Final)
 从  OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 升级到9.1 版本

提示升级前最好多开几个ssh连接,以防连接中断,连接不上ssh

下载
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
cp -rf /etc/ssh /etc/ssh.bak
ssh -V
yum install -y gcc openssl-devel pam-devel rpm-build pam-devel
tar -zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1/
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
echo $?
make && make install
cat /etc/ssh/sshd_config|grep RootLogin
 vi /etc/ssh/sshd_config
根据提示, 注释掉下面三行。注意提示有可能不同,主要是注释GSSAPI相关的内容
 /etc/ssh/sshd_config line 93: Unsupported option GSSAPIAuthentication
/etc/ssh/sshd_config line 94: Unsupported option GSSAPICleanupCredentials
/etc/ssh/sshd_config line 123: Deprecated option UsePrivilegeSeparation
根据提示有可能用到下面的命令(centos6 版本可能用不到,centos7 可能用到)
 chmod 0600 /etc/ssh/ssh_host_ed25519_key
 chmod 0600 /etc/ssh/ssh_host_rsa_key
 chmod 0600 /etc/ssh/ssh_host_ecdsa_key
 编辑/etc/ssh/sshd_config,将ClientAliveInterval设置为300到900,即5-15分钟,将ClientAliveCountMax设置为0-3之间。
ClientAliveInterval 900
ClientAliveCountMax 3
 
 service sshd restart
 service sshd status
 ssh -V
 ps -ax | grep ssh

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值