Press "Enter" to skip to content

主机升级openssh

主机环境Redhat 6.8
//先安装telnet服务,以防openssh升级失败主机无法连接
yum -y install telnet-server
vim /etc/xinetd.d/telnet //找到如下行,将yes改为no
disable = yes 将 yes 改成 no
service xinetd restart

#检查是否启动成功
netstat -anp | grep :23
#检查是否有防火墙
service iptables status

下载openssh-7.6p1.tar.gz
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz

//安装openssh
yum -y install gcc pam-devel zlib-devel openssl-devel
mv /etc/ssh /etc/ssh.old
rpm -e `rpm -qa|grep openssh`//卸载旧版本的openssh
tar -zxvf openssh-7.6p1.tar.gz
cd openssh-7.6p1
./configure --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers --with-ssl-dir=/usr/local/openssl
make
make install

mv /etc/init.d/sshd /etc/init.d/sshd.bak
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd

查看ssh版本
ssh -V

启动ssh
service sshd start

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注