概述
本文适用于Centos/Redhat 升级前请自行查看openssl是否为1.0.2k
RPM包在文章最后,请自行下载安装
前期准备:
开启telnet登录
备份openssh
备份配置文件/etc/ssh/ 下的所有文件
备份/etc/pam.d
实施环节:
一丶配置telnet登录
安装telnet-server、xinetd
yum -y install telnet telnet-server yum -y install xinetd
启用telnet和xinetd
systemctl enable xinetd systemctl enable telnet.socket systemctl start telnet.socket systemctl start xinetd.service
配置telnet终端
vim /etc/securetty #行尾添加 pts/0 pts/1 pts/2 pts/3
关闭防火墙和安全机制或允许访问23端口
systemctl disable firewalld.service systemctl stop firewalld.service setenforce 0
二丶升级openssh
备份ssh、pam.d 、openssh
cp -ar /etc/ssh /mnt/ cp -ar /etc/pam.d /mnt/ cp -a /usr/bin/ssh /mnt/ssh.bak cp -a /usr/sbin/sshd /mnt/sshd.bak
上传并解压rpm包
rz #选择rpm包 unzip OpenSSH89p1_For_RHEL7_Build20220411.zip
安装openssh
#查看现在openssh的版本 [root@centos-7 ~]# rpm -qa |grep openssh openssh-7.4p1-16.el7.x86_64 openssh-clients-7.4p1-16.el7.x86_64 openssh-server-7.4p1-16.el7.x86_64
移动到解压出来的OpenSSH89p1 For RHEL7 Build20220411目录,并升级openssh
#直升级现有的RPM包即可 cd OpenSSH89p1 For RHEL7 Build20220411/ rpm -Uvh openssh-server-8.9p1-1.el7.x86_64.rpm --force --nodeps rpm -Uvh openssh-8.9p1-1.el7.x86_64.rpm --force --nodeps rpm -Uvh openssh-clients-8.9p1-1.el7.x86_64.rpm --force --nodeps
查看是否升级成功
[root@centos-7 OpenSSH89p1 For RHEL7 Build20220411]# rpm -qa |grep openssh openssh-8.9p1-1.el7.x86_64 openssh-clients-8.9p1-1.el7.x86_64 openssh-server-8.9p1-1.el7.x86_64
恢复sshd配置文件并重启ssh服务
cp /mnt/ssh/sshd_config /etc/ssh systemctl restart sshd
测试是否能重新登录服务器,如登录成功,升级成功(步骤略)
关闭telnet和xinetd并取消开机自启
systemctl disable xinetd systemctl disable telnet.socket systemctl stop telnet.socket systemctl stop xinetd.service
删除telnet相关信息
yum remove telnet* vim /etc/securetty #删除行尾 pts/0 pts/1 pts/2 pts/3
提取码:7g2p
RPM包自提链接:https://pan.baidu.com/s/1dVn7gL02ox4tG9F-Ydsrkg
最后
以上就是危机世界为你收集整理的Linux以RPM方式升级openssh的全部内容,希望文章能够帮你解决Linux以RPM方式升级openssh所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复