欢迎光临
我们一直在努力

怎样升级openssh7.9

这期内容当中小编将会给大家带来有关怎样升级openssh7.9,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

umask 022
yum install -y pam-devel libselinux-devel krb5-devel zlib-devel gcc make
LANG=C
cd /root
tar xf openssl-1.0.2r.tar.gz

tar xf openssh-7.9p1.tar.gz
cd /root/openssl-1.0.2r
./config –prefix=/usr/local/openssl-1.0.2r –openssldir=/usr/local/openssl-1.0.2r zlib shared && make -j 4 && make install

echo '/usr/local/openssl-1.0.2r/lib' > /etc/ld.so.conf.d/openssl.conf
ldconfig
chmod 600 /etc/ssh/ssh_host_*

cd /root/openssh-7.9p1
./configure –prefix=/usr/local/openssh7.9p1 –sysconfdir=/etc/ssh –with-selinux –with-pam\
 –with-ssl-dir=/usr/local/openssl-1.0.2r\
 –with-md5-passwords –with-zlib –mandir=/usr/share/man\
 –with-kerberos5 –with-xauth –with-sandbox\
 && make -j 4 && make install 

alias cp='cp'

cp /root/openssh-7.9p1/contrib/redhat/sshd.init /etc/init.d/sshd

chmod +x /etc/init.d/sshd

cp -f /usr/local/openssh7.9p1/bin/* /usr/bin/
cp -f /usr/local/openssh7.9p1/sbin/* /usr/sbin/
cp -f /usr/local/openssh7.9p1/libexec/* /usr/libexec/openssh/

restorecon /usr/bin/{scp,sftp,ssh,ssh-add,ssh-agent,ssh-keygen,ssh-keyscan}
restorecon /usr/sbin/sshd
restorecon /usr/libexec/openssh/{sftp-server,ssh-keysign,ssh-pkcs11-helper}

以上代码可以放在一个文件中自动执行升级

升级完成后要执行,让root可以登录

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

如果已经设置了

chkconfig sshd on

但不能在重启后自动启动sshd服务,但可以手动开启服务成功,并有可能报错如下

[root@rhel6 init.d]# service sshd start
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.1.0.0: failed to map segment from shared object: Permission denied
[FAILED]

需要检查

getenforce是否是Enforcing,打开/etc/selinux的配置文件config,将SELINUX改为disabled。启动服务不再报错,重启系统

sshd服务可以自动启动了

上述就是小编为大家分享的怎样升级openssh7.9了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注云行业资讯频道。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。