openssh版本低漏洞
若是依赖 zlib、fips、openssl包与本文档版本一致则不需要更新,只需更新OpenSSH
- OpenSSH 安全限制绕过漏洞(CVE-2016-10012)
- OpenSSH J-PAKE授权问题漏洞(CVE-2010-4478)
- OpenSSH auth_password函数拒绝服务漏洞(CVE-2016-6515)
- OpenSSH 远程代码执行漏洞(CVE-2016-10009)
- OpenSSH do_setup_env函数权限提升漏洞(CVE-2015-8325)
- OpenSSH 安全漏洞(CVE-2016-1908)
- OpenSSH 'schnorr.c’远程内存破坏漏洞(CVE-2014-1692)
- Openssh MaxAuthTries限制绕过漏洞(CVE-2015-5600)
- OpenSSH 'x11_open_helper()'函数安全限制绕过漏洞(CVE-2015-5352)
- OpenSSH glob表达式拒绝服务漏洞(CVE-2010-4755)
- OpenSSH默认服务器配置拒绝服务漏洞(CVE-2010-5107)
- OpenSSH <=7.2p1 xauth命令注入漏洞(CVE-2016-3115)
- OpenSSH 远程权限提升漏洞(CVE-2016-10010)
- OpenSSH sshd mm_answer_pam_free_ctx释放后重利用漏洞(CVE-2015-6564)
- Portable OpenSSH 'ssh-keysign’本地未授权访问漏洞
将系统版本openssh升级至较高版本、或最新
oh=`rpm -qa|grep openssh`
rpm -e --nodeps $oh
echo $oh
install -v -m700 -d /var/lib/sshd
开始升级
pwd: /home/admin/openssl
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar -xf zlib-1.2.11.tar.gz
cd zlib-1.2.11 && ./configure && make && make install
ll /usr/local/lib
libz.so.1.2.11
wget http://mirrors.ibiblio.org/openssl/source/old/fips/openssl-fips-2.0.12.tar.gz
tar -xf openssl-fips-2.0.12.tar.gz && cd openssl-fips-2.0.12 && ./config && make && make install
wget http://mirrors.ibiblio.org/openssl/source/old/1.0.2/openssl-1.0.2i.tar.gz
tar -xf openssl-1.0.2i.tar.gz && cd openssl-1.0.2i && ./config && make && make install
cd /usr/local/ssl/bin && ln -sv /usr/local/ssl/bin/openssl /usr/bin/openssl (创建软连接前将当前的openssl备份)
openssl version -a(查看OpenSSL版本)
OpenSSL 1.0.2i22 Sep 2016
pwd:/home/admin/openssl
wget https://cloudflare.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.2p1.tar.gz
tar -xf openssh-8.2p1.tar.gz
cd openssh-8.2p1
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-md5-passwords --with-privsep-path=/var/lib/sshd && make
make install
ll /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
make install
install -v -m755 contrib/ssh-copy-id /usr/bin
install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1
install -v -m755 -d /home/admin/openssl/openssh-8.2p1
install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.2p1
mv /etc/init.d/sshd /etc/init.d/sshd20200506
pwd:/home/admin/openssl/openssh-8.2p1/contrib/redhat
cp -p shd.init /etc/init.d/sshd
chmod u+x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
systemctl restart sshd
pwd:/home/admin/openssl/openssh-8.2p1
cp ssh_config /etc/ssh/ssh_config
cp sshd_config /etc/ssh/sshd_config
- 修改配置文件(如禁root、端口等)重启SSH服务,检测其ssh新版本
echo 'X11Forwarding yes' >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
service sshd restart 或 systemctl restart sshd
ssh -V
OpenSSH_8.2p1, OpenSSL 1.0.2k-fips 11 Feb 2013
- windows的cmd远程telnet,查看ssh版本是否后变化
telnet 192.168.0.1 22