赞
踩
所有安装包下载地址:
链接:https://pan.baidu.com/s/1INkUPgBCrv2Dx05PE5XVLA
提取码:i627
所有服务器的openssh更新的都是统一的上传文件目录: /tools/openSSH,因为openSSH升级可能涉及到几台甚至几十台服务器,统一的路径便于同时多台服务器做升级操作及后期维护
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/
建议安装,如果你升级到一半,VPN突然掉了,或者网络断开,你就连不上xshell了,如果安装了telnet后,就是网络和VPN断开,也可以进行下一步操作
systemctl disable xinetd.service
systemctl disable telnet.socket
rpm -e --nodeps telnet-0.17-47.el6.x86_64
rpm -e --nodeps telnet-server-0.17-64.el7.x86_64
注意: 需要先安装xinetd,然后安装telnet客户端,再安装telnet服务端,不然可能会报错
rpm -ivh xinetd-2.3.14-38.el6.x86_64.rpm
rpm -ivh telnet-0.17-47.el6.x86_64.rpm
rpm -ivh telnet-server-0.17-64.el7.x86_64.rpm
systemctl enable xinetd.service
systemctl enable telnet.socket
cat /etc/services | grep -a 'telnet'
开放root用户的权限,编辑以下文件.注释掉这一行:auth required pam_securetty.so
然后关闭centos7防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
rpm -ivh *.rpm --nodeps --force
https://ftp.openssl.org/source/old/1.0.2/
tar -zxvf openssl-1.0.2.tar.gz -C /training/
./config shared && make && make install
以上命令执行完毕,echo $?查看下最后的make install是否有报错,0表示没有问题
[root@gnc-4a-umap-03 openssl-1.0.2]# ll /usr/bin/openssl
[root@gnc-4a-umap-03 openssl-1.0.2]# mv /usr/bin/openssl /usr/bin/openssl_bak
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
[root@gnc-4a-umap-03 openssl-1.0.2]# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
[root@gnc-4a-umap-03 openssl-1.0.2]# /sbin/ldconfig
五:编译安装(openssl-devel;pam-devel;openSSH)
在本地的centos镜像文件下的O:\Packages目录下,依次找到下列文件,然后进行上传
cd /tools/openSSH/openssl-devel
rpm -ivh *.rpm --nodeps --force
yum install openssl openssl-devel -y
http://rpmfind.net/linux/rpm2html/search.php?query=pam-devel(x86-64)
rpm -ivh pam-devel-1.1.8-23.el7.x86_64.rpm --nodeps --force
tar -zxvf openssh-8.0p1.tar.gz -C /training/
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/ssl/include \
--with-ssl-dir=/usr/local/ssl --with-zlib --with-md5-passwords --with-pam && make && make install
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/ssl/include \
--with-ssl-dir=/usr/local/ssl --with-zlib --with-md5-passwords --with-pam && make && make install
取消注释#PermitRootLogin yes,也就是说给root登录放行
下面的文件根据启动需要看是否拷贝,如果启动报sshd:未识别的服务,就需要拷贝下列文件
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
把原先的systemd管理的sshd文件删除或者移走或者删除,不移走的话影响我们重启sshd服务
mv /usr/lib/systemd/system/sshd.service /training/
[root@gnc-4a-umap-03 openssh-8.0p1]# /etc/init.d/sshd stop
[root@gnc-4a-umap-03 openssh-8.0p1]# /etc/init.d/sshd start
[root@gnc-4a-umap-03 openssh-8.0p1]# /etc/init.d/sshd restart
[root@gnc-4a-umap-03 openssh-8.0p1]# ssh -V
OpenSSH_8.0p1, OpenSSL 1.0.2 22 Jan 2015
7.3:关闭telnet服务
ssh升级成功后,telnet就用不上了,这时可以将其服务关闭,恢复原始状态
systemctl disable xinetd.service
systemctl disable telnet.socket
rpm -e --nodeps telnet-server-0.17-64.el7.x86_64
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。