CentOS 7.x 升级OpenSSH-8.1p1
[root@centos7 ~]# mkdir packages
[root@centos7 ~]# cd packages/
[root@centos7 packages]# wget https://cikeblog.com/s/openssh8.1.tar.gz
[root@centos7 packages]# tar -zxvf openssh8.1.tar.gz
[root@centos7 packages]# yum install ./*.rpm
[root@centos7 packages]# ssh -V
OpenSSH_8.1p1, OpenSSL 1.0.2k-fips  26 Jan 2017
[root@centos7 packages]# cd /etc/ssh/
[root@centos7 ssh]# chmod 400 ssh_host_ecdsa_key ssh_host_ed25519_key ssh_host_rsa_key
[root@centos7 ssh]# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
[root@centos7 ssh]# echo "PasswordAuthentication yes"  >> /etc/ssh/sshd_config
[root@centos7 ssh]# vi /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
session    required     pam_selinux.so close
session    required     pam_loginuid.so
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth
[root@centos7 ssh]# systemctl restart sshd # 断开重新链接,验证SSH可用性
上一篇
下一篇