zoukankan      html  css  js  c++  java
  • openssh升级的坑爹之路

    安装Zlib

    http://zlib.net/zlib-1.2.8.tar.gz

    tar -zxvf zlib-1.2.8.tar.gz

    cd zlib-1.2.8

    ./configure --shared

                           

    make

    make test

    make install

    三、安装OpenSSL

    tar zxf openssl-1.0.2j.tar.gz

    cd openssl-1.0.2j/

    ./config --prefix=/usr/  --shared(默认安装路径/usr/local/ssl)

    make

    make test

    (确认编译是否有问题)

    make install

    vi /etc/ld.so.conf  在第一行加  /usr/local/ssl/lib

    /usr/local/lib

    之后ldconfig

    让配置文件生效

    最后查看当前openssl版本信息

    openssl version -a

    四、安装OpenSSH

    tar zxf openssh-7.3p1-CVE-2016-8858.tar.gz

    如为原版openssh-7.3p1包则添加下图代码,此包已经添加过。

    cd openssh-7.3p1/

    解压openssh源码包,修改源码包根目录中的kex.c文件

    搜debug("SSH2_MSG_KEXINIT received"); 在这附近

    加ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);

    ./configure --prefix=/usr --sysconfdir=/etc/ssh --without-zlib-version-check --with-ssl-dir=/usr/ --with-pam --with-zlib --mandir=/usr/share/man --with-md5-passwords

     (标红的部分是openssh安装的文件目录,可以自定义)

    make

    (make之后没有报错)

    make install

    #分享下我做的过程
    yum -y install zlib-devel*
    yum -y install openssl-devel*
    yum -y install perl* gcc* pam*
    
    
    cd openssl-1.0.2l
    ./config --prefix=/usr --shared
    make && make install
    
    
    #将pam中的一个包拷出来,没有这个包ulimit会失效
    cd /etc/pam.d/
    cp sshd /root
    
    rpm -e --nodeps `rpm -qa | grep openssh`
     ./configure --prefix=/usr --sysconfdir=/etc/ssh --without-zlib-version-check --with-ssl-dir=/usr/ --with-pam --with-zlib --mandir=/usr/share/man --with-md5-passwords
     cp ./contrib/redhat/sshd.init /etc/init.d/sshd
    chkconfig --add sshd
    
    #改掉ssh配置文件中的权限 chmod 600 /etc/ssh/ssh_host_rsa_key chmod 600 /etc/ssh/ssh_host_ecdsa_key chmod 600 /etc/ssh/ssh_host_ed25519_key service sshd restart ssh -V
  • 相关阅读:
    【原创】用python写的一个监测本地进程CPU占用的程序
    CSS清除浮动的7种方法以及优缺点
    JavaScript函数作用域
    BOM的概念以及相关操作
    文件与文件系统的压缩与打包
    CSRF
    netstat 命令详解
    httpd安装
    ubuntu 耳机没声音
    Linu正常使用MobaXterm
  • 原文地址:https://www.cnblogs.com/sexiaoshuai/p/7262141.html
Copyright © 2011-2022 走看看