Redhat 6.5源码编译升级openssh到7.8版本

  • A+
所属分类:LINUX运维 网站首页

1.检验升级OpenSSH依赖的相关组件

  1. [root@web02 /]# rpm -qa | grep gcc  
  2. [root@web02 /]# rpm -qa | grep zlib-devel  
  3. [root@web02 /]# rpm -qa | grep openssl-devel  
  4. [root@web02 /]# rpm -qa | grep  pam-devel  

# rpm -qa | grep pam-devel
如没有,直接用yum安装。

  1. [root@web02 /]# yum install gcc zlib-devel pam-devel   openssl-devel  

2.源码编译安装OpenSSh的7.8版本

  1. [root@web02 /]# mv /etc/ssh/ /etc/ssh.bak  
  2. [root@web02 /]# wget https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-7.8p1.tar.gz  
  3. [root@web02 /]# tar -xf openssh-7.8p1.tar.gz  
  4. [root@web02 /]# cd openssh-7.8p1  
  5. [root@web02 /]# ./configure --prefix=/usr --with-zlib --sysconfdir=/etc/ssh --with-ssl-dir=/usr --with-md5-passwords --with-pam  
  6. [root@web02 /]# make  
  7. [root@web02 /]# make install  
  8. [root@web02 /]# mv /etc/ssh  /etc/ssh-7.8p1-conf  
  9. [root@web02 /]# mv /etc/ssh.bak/ /etc/ssh  
  10. [root@web02 /]# sed -i '/^#PermitRootLogin/s/#PermitRootLogin yes/PermitRootLogin yes/'/etc/ssh/sshd_config  
  11. 或手动修改PermitRootLogin no 修改为 PermitRootLogin yes 允许root远程登陆。  
  12. [root@web02 /]# sed -i '/^GSSAPIAuthentication yes/s/GSSAPIAuthentication yes/#GSSAPIAuthentication yes/'/etc/ssh/sshd_config  
  13. [root@web02 /]# sed -i '/^GSSAPICleanupCredentials yes/s/GSSAPICleanupCredentials yes/#GSSAPICleanupCredentials yes/'/etc/ssh/sshd_config  
  14. [root@web02 /]# cp /etc/ssh-7.8p1-conf/ssh_host_ecdsa_key /etc/ssh  
  15. [root@web02 /]# cp /etc/ssh-7.8p1-conf/ssh_host_ed25519_key /etc/ssh  

3.重启查看版本

  1. [root@web02 openssh-7.8p1]# service sshd restart  
  2. 停止 sshd:[确定]  
  3. 正在启动 sshd:[确定]  
  4. [root@web02 openssh-7.8p1]# ssh -V  
  5. OpenSSH_7.8p1, OpenSSL1.0.1e-fips 11Feb2013  
  6. [root@web02 openssh-7.8p1]#  

#
升级完成。

moonrong
  • 版权声明:本站原创文章,于2020年9月22日17:36:05,由 发表,共 1579 字。
  • 版权声明: 本文由于2020年9月22日17:36:05 发表在 好派笔记,共 1579 字。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: