Linux升级ssh、ssl

yum install -y gcc openssl-devel pam-devel rpm-build  【下载相关依赖包】

wget http://10.10.8.8/openssl-1.0.2p.tar.gz   【下载ssl,可到相应资源网站去下载最新】

tar -zxvf openssl-1.0.2p.tar.gz && cd openssl-1.0.2p  【解压】

./config --prefix=/usr/local/openssl --shared

make  && make install  【编译及安装】

mv /usr/bin/openssl /usr/bin/openssl.bak

mv /usr/include/openssl /usr/include/openssl.bak

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

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

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

ldconfig -v

openssl version -a

cd /root/Desktop

wget http://10.10.8.8/openssh-7.9p1.tar.gz  【下载ssh,到相应资源网站下载】

rpm -e `rpm -qa | grep openssh` --nodeps

tar -zxvf openssh-7.9p1.tar.gz && cd openssh-7.9p1

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib --with-md5-passwords --with-pam --with-tcp-wrappers  【可能会出现:configure: error: PAM headers not found 错误,需要安装pam-devel的rpm包
# yum install  –y  pam-devel 】

make && make install

sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin\ yes/g' /etc/ssh/sshd_config 【允许root远程登陆】  【sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config】
sed -i 's/#PermitEmptyPasswords\(.*\)/PermitEmptyPasswords\ no/g' /etc/ssh/sshd_config 【禁止空密码】  【sed -i 's/#PermitEmptyPasswords\(.*\)/PermitEmptyPasswords no/g' /etc/ssh/sshd_config】图形化界面可以直接修改

cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
service sshd start
service sshd restart
chkconfig --list sshd
ssh -V
rm -rf /root/Desktop/openssl-1.0.2p.tar.gz
rm -rf /root/Desktop/openssl-1.0.2p
rm -rf /root/Desktop/openssh-7.9p1.tar.gz
rm -rf /root/Desktop/openssh-7.9p1
rm -rf /root/Desktop/w.txt

 

转载于:https://www.cnblogs.com/Funmixture/p/10523236.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值