Linux 升级最新版本openSSH 7.8p

*注意:如果一次安装失败,下次安装前解压缩的目录一定要删除

依赖包以及主包

升级openssh前需要先升级依赖包,教程如下

1、zlib-1.2.11.tar.gz

# tar xzvf zlib-1.2.11.tar.gz

#cd zlib-1.2.11

# ./configure --prefix=/usr/local/zlib
# make
# make install

这样,就把 zlib 编译安装在
/usr/local/zlib 中了

2、pam-devel-1.1.1-13.el6.x86_64.rpm

# rpm -ivh pam-devel-1.1.1-13.el6.x86_64.rpm

3、openssl-fips-2.0.16.tar.gz

# tar -xzvf openssl-fips-2.0.16.tar.gz

# cd openssl-fips-2.0.16

# ./config

# make

# make install

4、openssl-1.0.2p.tar.gz

#tar -zxvf   openssl-1.0.2p.tar.gz

#cd  /openssl-1.0.2p

#./config shared zlib --prefix=/usr/local/openssl && make && make install

# ./config -t

# make depend

# cd /usr/local

# ln -s openssl ssl

# vi /etc/ld.so.conf    

文件的最后面,添加如下内容:

/usr/local/openssl/lib

#ldconfig

在etc/的profile的最后一行,添加:

      export OPENSSL=/usr/local/openssl/bin

      export PATH=$OPENSSL:$PATH:$HOME/bin

移除老版本的openssl,创建新的软连接;这个地方注意路径

mv /usr/bin/openssl /usr/bin/openssl.old

mv /usr/include/openssl /usr/include/openssl.old

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/openssl/include/openssl /usr/include/openssl

ln -sf /usr/local/openssl/lib/libcrypto.so.1.0.0 /lib/libcrypto.so.6

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

ldconfig -v
# openssl version

4、openssh-7.8p1.tar.gz

 #tar -xzvf openssh-7.8p1.tar.gz

# cd openssh-7.8p1

# rm -rf /etc/ssh

#make uninstall     删除旧版本

#./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib --without-hardening

#make

#make install

# cp /你的openssh的解压目录/contrib/redhat/sshd.init /etc/init.d/sshd

# chmod +x /etc/init.d/sshd

# chkconfig --add sshd

#vim /etc/ssh/sshd_config #修改默认端口号

#service sshd stop

# /etc/init.d/sshd restart  或 service sshd start

#cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd

#cp /usr/local/openssh/bin/ssh /usr/bin/

 

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值