亲测5.9 32位-6.5 64位可用,无需删除旧版本ssh 编译安装。
1.建立备用连接。telnet
yum install telnet telnet-server
vi /etc/xinetd.d/telnet //把disable = yes改成no,或直接注释掉;
service xinetd restart
chkconfig --list|grep telnet
------5.9
chkconfig krb5-telnet on
chkconfig --list|grep telnet
echo "pts/1" >> /etc/securetty
echo "pts/2" >> /etc/securetty
echo "pts/3" >> /etc/securetty
service xinetd restart
-------------------------
2.开始升级 openssl 漏洞补丁
升级openssl
1.检查编译库
rpm -qa |grep zlib*
rpm -qa |grep gcc
rpm -qa |grep make
openssl version -a
cd /root/soft
tar zxvf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
./config --prefix=/usr --shared
make
make test
make install
查看监听端口
netstat -antup
检查当前安装的版本
rpm -qa | grep openssl
openssl version -a
——————————————————————
升级openssh 漏洞补丁,此版本为openssh 7.2p2
三 openssh 安装
cd ..
tar zxvf openssh-7.2p2.tar.gz
cd openssh-7.2p2
在命令行中执行以下命令,注意下面是一条整体的命令
install -v -m700 -d /var/lib/sshd &&
chown -v root:sys /var/lib/sshd &&
groupadd -g 50 sshd &&
useradd -c ‘sshd PrivSep‘ \
-d /var/lib/sshd \
-g sshd \
-s /bin/false \
-u 50 sshd
--------------------------------------------
进入解压目录,在命令行执行以下命令,注意下面是一条整体的命令
./configure --prefix=/usr \
--sysconfdir=/etc/ssh \
--with-md5-passwords \
--with-privsep-path=/var/lib/sshd &&
make
------------------------------------------
上面执行完后,且没报错,则再执行下面这条命令:注意下面是一条整体的命令
文件名注意!!!!!!
make install &&
install -v -m755 contrib/ssh-copy-id /usr/bin &&
install -v -m644 contrib/ssh-copy-id.1 \
/usr/share/man/man1 &&
install -v -m755 -d /usr/share/doc/openssh-7.2p2 &&
install -v -m644 INSTALL LICENCE OVERVIEW README* \
/usr/share/doc/openssh-7.2p2
5、执行完后 ,不报错,可以验证一下安装信息
whereis ssh
ssh -V
cd /etc/ssh
cp sshd_config sshd_config_bak
vi sshd_config
将PermitRootLogin yes前面的#号去掉,
注释掉以下配置:
# GSSAPI options
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
#UsePAM yes
在文件的最后,增加以下内容(以下内容整体复制) 以下内容会影响sftp传输
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
service sshd restart
本文出自 “7987021” 博客,请务必保留此出处http://7997021.blog.51cto.com/7987021/1863915
原文地址:http://7997021.blog.51cto.com/7987021/1863915