温馨提示×

温馨提示×

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

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

怎样升级openssh7.9

发布时间:2021-11-06 15:19:19 来源:亿速云 阅读:90 作者:柒染 栏目:建站服务器

这期内容当中小编将会给大家带来有关怎样升级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了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。

向AI问一下细节

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

AI