centos7离线升级openssh到1.9

1、准备依赖包rpm,在rpm文件夹内执行

rpm -Uvh *.rpm --nodeps --force 

2、备份旧ssh配置文件

mv /etc/ssh/ /home/ssh-bak

3、查看当前SSH版本

[root@localhost ~]# rpm -qa | grep openssh
openssh-server-7.4p1-16.el7.x86_64
openssh-7.4p1-16.el7.x86_64
openssh-clients-7.4p1-16.el7.x86_64

4、卸载老版本SSH

yum remove openssh-7.4p1-16.el7.x86_64

5、解压 openssh-7.9p1.tar.gz

tar -zxvf openssh-7.9p1.tar.gz

6、进入openssh-7.9p1文件夹

cd openssh-7.9p1

7、编译安装

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --without-hardening

8、安装

make&make install 

9、修改配置,允许root远程访问

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

10、配置启动以及开机启动

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

11、重启

service sshd restart

12、关闭selinux

vi /etc/selinux/config
修改:
SELINUX=disabled
保存退出。
临时关闭:setenforce 0

注:sshd启动失败,ssh一直重复自启,远程ssh有时连接上,有时连接不上,查找log没问题时,极有可能是老版本未卸载,查看卸载。
安装包: https://download.csdn.net/download/u010124754/11064978

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值