centos 6 安装升级openssh 9.1
需要的rpm包:
openssh-9.1p1-1.el6.x86_64.rpm
openssh-clients-9.1p1-1.el6.x86_64.rpm
openssh-server-9.1p1-1.el6.x86_64.rpm
1. 备份现有的配置文件和权限文件
cp -rp /etc/ssh /etc/ssh_backup
cp -rp /etc/pam.d/sshd /etc/pam.d/sshd
2.安装新版本openssh rpm包
yum localinstall *.rpm
3.检查验证安装
rpm -qa | grep openssh
openssh-clients-9.1p1-1.el6.x86_64
openssh-9.1p1-1.el6.x86_64
openssh-server-9.1p1-1.el6.x86_64
#检查ssh版本
ssh -V
OpenSSH_9.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013
4.修改配置、文件权限
cat /etc/pam.d/sshd
#%PAM-1.0
auth required pam_sepermit.so
auth include password-auth
account required pam_nologin.so
account include password-auth
password include password-auth
## pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
## pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open env_params
session optional pam_keyinit.so force revoke
session include password-auth
chmod 400 /etc/ssh/ssh_host*
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
5.重启服务验证
service sshd restart
service sshd status
sshd (pid 12297) 正在运行...