温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

升级openssh版本

发布时间:2020-05-02 07:49:44 来源:网络 阅读:703 作者:sendoffice 栏目:开发技术

有网络情况下


1 下载包,编译

tar zxvf openssh-7.1p1.tar.gz
cd openssh-7.1
./configure --prefix=/usr --sysconfdir=/etc/ssh
make
make install

2 解决如下环境报错:

   configure: error: *** zlib.h missing - please install first or check config.log ***

  yum install openssl openssl-devel -y


3 编译

yum install make automake gcc gcc-c++ gcc-g77 -y

4 覆盖配置文件

   make install覆盖/etc/ssh配置文件时可能会报错,删掉/etc/ssh下的报错配置文件,再make install一次就可以了。但是有时候可能需要把整个代码删掉重新解压重复以上过程。


5 如果使用root远程无法登录,修改/etc/ssh/sshd_config

   PermitRootLogin yes。


6 查看升级后的版本

/usr/bin/ssh -V


无网络如何升级

1、准备相关的包

   openssh下载地址:http://mirror.internode.on.net/pub/OpenBSD/OpenSSH/portable/

   openssl相关包下载:http://www.openssl.org/source/

   pam相关包下载:http://pkgs.org/centos-6/centos-x86_64/

   zlib包下载: http://zlib.net/

2、安装zlib

   tar -zxvf zlib-1.2.8.tar.gz
   cd zlib-1.2.8
   ./configure --prefix=/usr/local/zlib && make && make install

3、安装openssl-fips

   tar zxvf openssl-fips-2.0.5.tar.gz
   cd openssl-fips
   ./config
   make && make install

4、安装openssl

    tar -zxvf openssl-1.0.1h.tar.gz
    cd openssl-1.0.1h
    ./config fips --shared    
    make && make install

5、将新编译的openssl library 加入系统动态库链接中

    echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
    ldconfig

6、安装pam,首先卸载旧版本

    查看版本信息:rpm -qa|grep pam
    卸载旧版本:rpm -e --nodeps pam-1.1.1-17.el6.x86_64

    安装pam:依次安装
    rpm -ivh tcp_wrappers-devel-7.6-57.el6.x86_64.rpm
    pam-1.1.1-20.el6_7.1.x86_64.rpm
    pam-devel-1.1.1-20.el6_7.1.x86_64.rpm

7、安装OpenSSH
    tar zxvf openssh-7.1p1.tar.gz
    cd openssh-7.1p1
    ./configure \
--prefix=/usr \
--sysconfdir=/etc/ssh \
--with-md5-passwords \
--with-pam \
--with-tcp-wrappers \
--with-ssl-dir=/usr/local/ssl \
--with-zlib=/usr/local/zlib \
--without-hardening
    make && make install

8、加入到系统服务,重启sshd升级成功
    chkconfig --add sshd
    service sshd restart


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI