• centos 6&7 升级openssh


    1.查看现在的版本

    # rpm -qa | grep openssh
    openssh-clients-6.6.1p1-22.el7.x86_64
    openssh-server-6.6.1p1-22.el7.x86_64
    openssh-6.6.1p1-22.el7.x86_64
    

     

    2.下载新版本的openssh

    cd /usr/src
    wget http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz
    tar -xvzf openssh-7.4p1.tar.gz
    

      

    3.安装辅助包

    yum install rpm-build gcc make wget openssl-devel krb5-devel pam-devel libX11-devel xmkmf libXt-devel
    

      

    4.创建对应目录

    mkdir -p /root/rpmbuild/{SOURCES,SPECS}
    cp ./openssh-7.5p1/contrib/redhat/openssh.spec /root/rpmbuild/SPECS/
    cp openssh-7.5p1.tar.gz /root/rpmbuild/SOURCES/
    cd /root/rpmbuild/SPECS/
    

      

    5.修改

    sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" openssh.spec
    sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" openssh.spec
    sed -i -e "s/BuildPreReq/BuildRequires/g" openssh.spec
    

      

    6.build rpm

    rpmbuild -bb openssh.spec
    

    7.查看生成的rpm

    # cd /root/rpmbuild/RPMS/x86_64/
    # ll
    total 2112
    -rw-r--r-- 1 root root 758392 Jun 17 15:27 openssh-7.5p1-1.x86_64.rpm
    -rw-r--r-- 1 root root 945325 Jun 17 15:27 openssh-clients-7.5p1-1.x86_64.rpm
    -rw-r--r-- 1 root root 452499 Jun 17 15:27 openssh-server-7.5p1-1.x86_64.rpm
    

      

    8.升级

    # rpm -Uvh *.rpm
    Preparing...                ########################################### [100%]
       1:openssh                ########################################### [ 33%]
       2:openssh-clients        ########################################### [ 67%]
       3:openssh-server         ########################################### [100%]
    

      

    9.查看

    # ssh -V
    OpenSSH_7.5p1, OpenSSL 1.0.1e-fips 11 Feb 2013
    # rpm -qa | grep openssh
    openssh-clients-7.5p1-1.x86_64
    openssh-7.5p1-1.x86_64
    openssh-server-7.5p1-1.x86_64
    

      

  • 相关阅读:
    找到数组中消失的所有数字-算法刷题总结
    爬楼梯-算法练习笔记
    最长公共前缀-刷题总结
    每日温度-算法详细分析
    买卖股票的最佳时机-算法详细分析
    回文数-算法详细分析
    合并两个有序链表-算法详细法分析
    最短无序连续子数组 | 算法详细分析
    整数反转-算法详细分析
    python设计模式之责任链模式
  • 原文地址:https://www.cnblogs.com/abclife/p/7040349.html
Copyright © 2020-2023  润新知