网站建设题目以及答案,大良营销网站建设新闻,邢台做移动网站公司电话号码,wordpress support hls player近期因为openssh相继被漏洞扫描工具扫出存在漏洞#xff0c;所以考虑升级操作系统中的openssh和openssl为最新版本#xff0c;来避免漏洞风险。期间的升级过程及遇到的疑难问题#xff0c;特此记录下来#xff0c;供有需要的人参考。 本次目标是升级 openssh 为 9.7p1 版本… 近期因为openssh相继被漏洞扫描工具扫出存在漏洞所以考虑升级操作系统中的openssh和openssl为最新版本来避免漏洞风险。期间的升级过程及遇到的疑难问题特此记录下来供有需要的人参考。 本次目标是升级 openssh 为 9.7p1 版本升级 openssl 为 1.1.1h 版本。环境为 kylin-SP2 服务器版操作系统。
一、下载源码并编译安装。
1、下载源码。
openssh下载地址https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/ openssl下载地址https://github.com/openssl/openssl/releases?page2
下载好源码上传到服务器上。
2、编译安装安装问题请参考后边说明。
解压openssl源码包并编译安装。
tar zxf openssl-1.1.1h.tar.gz
cd openssl-1.1.1h
./config --prefix/usr/local/ssl --openssldir/usr/local/ssl shared zlib
make make install解压openssh源码包并编译安装。
tar zxf openssh-9.7p1.tar.gz
cd openssh-9.7p1
./configure --prefix/usr --with-ssl-dir/usr/local/ssl --sysconfdir/etc/ssh --with-pam --with-gssapi --with-rsa --with-rhosts-allowed --with-zlib --with-md5-passwords
make make install查看openssh和openssl版本号命令
ssh -V
sshd -v
openssl version二、常见问题解答
1提示缺少 pam 库。
解决方法
yum install -y pam-devel2提示当前系统的openssl版本和库文件对应不上。 解决方法1 一般openssl会涉及到两个库文件分别为 libcrypto.so.1.1 和 libssl.so.1.1 需要检查两个软链接所引用的实际文件的版本号是否与 openssl version 所查看到的版本号相匹配。
解决方法2 在编译时增加参数–without-openssl-header-check
3升级成功之后使用命令重启ssh一直处于Active: activatingauto-restart状态sshd.service前面显示灰色不正常。看着并不影响登录使用。
原因分析 出现报错sshd.service holdoff time over, scheduling restart. 是因为ssh启动后没有给systemd发消息systemd就一直等超时后就重启ssh导致ssh频繁挂起但未启动成功。
解决方法 修改源码在 openssh-9.7p1 目录下找到 sshd.c 文件找到调用 server_accept_loop 函数的地方在上边增加一行 sd_notify(0, “READY1”); 然后在源文件开头添加引用头文件 #include systemd/sd-daemon.h 完成后还需要确保系统中存在 systemd-devel 软件包才可然后才能进行安装。安装命令为yum install systemd-devel 在执行完configure之后会生成预编译文件Makefile找到变量 LIBS增加 -lsystemd 最后进行make和make install即可。
4提示不支持的参数GSSAPIAuthentication、GSSAPICleanupCredentials、RSAAuthentication、RhostsRSAAuthentication。 解决方法 在/etc/ssh/sshd_config文件中注释掉上边不支持的参数即可。
sed -i s/^GSSAPIAuthentication/#/ /etc/ssh/sshd_config
sed -i s/^GSSAPICleanupCredentials/#/ /etc/ssh/sshd_config
sed -i s/^RSAAuthentication/#/ /etc/ssh/sshd_config
sed -i s/^RhostsRSAAuthentication/#/ /etc/ssh/sshd_config5使用scp命令时提示bad配置参数GSSAPIKexAlgorithms。
解决方法 在/etc/crypto-policies/back-ends/openssh.config文件中注释掉上边的配置参数即可。
sed -i s/^GSSAPIKexAlgorithms/#/ /etc/crypto-policies/back-ends/openssh.config6使用ssh命令提示不支持的参数GSSAPIAuthentication。 解决方法 在/etc/ssh/ssh_config.d/05-redhat.conf文件中注释掉上边不支持的参数即可。
sed -i s/GSSAPIAuthentication/#/ /etc/ssh/ssh_config.d/05-redhat.conf