OpenSSH 安全漏洞(CVE-2023-38408)
升级OpenSSH至安全版本(9.3p2+)
1. 准备依赖包
yum install -y wget gcc pam-devel libselinux-devel zlib-devel openssl-devel
2. 下载源码包
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p2.tar.gz
tar -zxvf openssh-9.3p2.tar.gz
cd openssh-9.3p2
3. 编译与安装
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl
make && make install
若OpenSSL版本低于1.0.1:
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz tar -zxvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w ./config --prefix=/usr/local/openssl
make && make install
验证版本:
ssh -V # 应输出OpenSSH_9.3p2
启动
service sshd start
*****************************************
出现启动错误:
1、vim /etc/ssh/sshd_config
注释掉下列三行:
GSSAPIAuthentication no
GSSAPICleanupCredentials no
UsePAM yes
改为
*GSSAPIAuthentication no
*GSSAPICleanupCredentials no
*UsePAM yes
2、修改文件权限
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
3、启动
service sshd start
4、查看状态
service sshd status