Linux 升级openssh7.4
环境:CentOS 6.5
提前开telnet 服务
http://zlib.net/zlib-1.2.8.tar.gz
准备安装包
第一步:
解压:zlib-1.2.8.tar.gz
[root@dbaul01 openssh]# tar -xvf zlib-1.2.8.tar.gz
[root@dbaul01 openssh]# cd zlib-1.2.8
[root@dbaul01 zlib-1.2.8]# ./configure
[root@dbaul01 zlib-1.2.8]# make
[root@dbaul01 zlib-1.2.8]# make install
查看
[root@dbaul01 zlib-1.2.8]# ll /usr/local/lib
第二步:
查看目前的openssl版本
[root@dbaul01 openssh]# openssl version
先安装一个openssl-fips
[root@bogon openssh]# tar -xvf openssl-fips-2.0.12.tar.gz
[root@bogon openssl-fips-2.0.12]# ./config
[root@bogon openssl-fips-2.0.12]# make
[root@bogon openssl-fips-2.0.12]# make install
安装openssl-fips 完毕
第三步:
安装openssl-1.0.2i
[root@bogon openssl-1.0.2i]# ./config
[root@bogon openssl-1.0.2i]# make
[root@bogon openssl-1.0.2i]# make install
[root@bogon openssl-1.0.2i]# cd /usr/local/ssl/
[root@bogon ssl]# cd bin/
[root@bogon bin]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
[root@bogon bin]# openssl version -a
第四步:
安装openssh-7.4p1
http://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssh.html
[root@dbaul01 openssh-7.4p1]# ./configure --prefix=/usr \
--sysconfdir=/etc/ssh \
--with-md5-passwords \
--with-privsep-path=/var/lib/sshd
检查出现error
configure: error: PAM headers not found
缺失 PAM-header
安装 PAM-header
[root@dbaul01 openssh]# yum install pam-devel.x86_64 -y
再次编译
[root@dbaul01 openssh-7.4p1]# ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl --without-hardening
编译成功
[root@dbaul01 openssh-7.4p1]# make
[root@dbaul01 openssh-7.4p1]# make install
[root@localhost redhat]# pwd
/root/openssh/openssh-7.4p1/contrib/redhat
[root@localhost redhat]# mv /etc/init.d/sshd /etc/init.d/sshd20161222
[root@localhost redhat]# cp sshd.init /etc/init.d/sshd
[root@localhost redhat]# chmod u+x /etc/init.d/sshd
[root@localhost redhat]# chkconfig --add sshd
[root@localhost openssh-7.4p1]# cp ssh_config /etc/ssh/ssh_config
cp: overwrite `/etc/ssh/ssh_config'? y
[root@localhost openssh-7.4p1]# cp -p sshd_config /etc/ssh/sshd_config
cp: overwrite `/etc/ssh/sshd_config'? y
[root@localhost openssh-7.4p1]#
[root@localhost openssh-7.4p1]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2i 22 Sep 2016
安装完毕