查rpm包上 https://crpm.cn
centos8 openssh 8.6 rpm 下载 http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-8.6p1-1.el8.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-clients-8.6p1-1.el8.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-server-8.6p1-1.el8.x86_64.rpm centos7 openssh 8.6 rpm 下载 http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-8.6p1-1.el7.centos.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-askpass-8.6p1-1.el7.centos.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-server-8.6p1-1.el8.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-clients-8.6p1-1.el7.centos.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-server-8.6p1-1.el7.centos.x86_64.rpm centos6 openssh 8.6 rpm 下载 http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-8.6p1-1.el6.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-askpass-8.6p1-1.el6.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-askpass-gnome-8.6p1-1.el6.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-clients-8.6p1-1.el6.x86_64.rpm http://mirrors.crpm.cn/openssh/x86_64/Packages/openssh-server-8.6p1-1.el6.x86_64.rpm
安装脚本
ssh -V OpenSSH_8.0p1, OpenSSL 1.1.1g FIPS 21 Apr 2020 ##脚本 cat a.sh #!/bin/bash NowTime=$(/bin/date +%Y%m%d%H%M%S) if [[ "$(whoami)" != "root" ]]; then echo "please run this script as root !" >&2 exit 1 fi if [[ ! -f /usr/bin/cp ]]; then echo "/usr/bin/cp file exists" >&2 exit 1 fi if [[ ! -d "/opt/backup/openssh_bak" ]];then mkdir -p /opt/backup/openssh_bak/ /usr/bin/cp /etc/pam.d/sshd /opt/backup/openssh_bak/sshd.bak /usr/bin/cp /etc/pam.d/system-auth /opt/backup/openssh_bak/system-auth.bak /usr/bin/cp /etc/ssh/sshd_config /opt/backup/openssh_bak/ /usr/bin/cp /etc/ssh/ssh_config /opt/backup/openssh_bak/ /usr/bin/cp /etc/ssh/ssh*key /opt/backup/openssh_bak/ else mkdir -p "/opt/backup/openssh_$NowTime/" /usr/bin/cp /etc/pam.d/sshd "/opt/backup/openssh_$NowTime/sshd.bak" /usr/bin/cp /etc/pam.d/system-auth "/opt/backup/openssh_$NowTime/system-auth.bak" /usr/bin/cp /etc/ssh/sshd_config "/opt/backup/openssh_$NowTime/" /usr/bin/cp /etc/ssh/ssh_config "/opt/backup/openssh_$NowTime/" /usr/bin/cp /etc/ssh/ssh*key "/opt/backup/openssh_$NowTime/" fi yum localinstall openssh-*.rpm -y chmod 600 /etc/ssh/ssh_host_*_key /usr/bin/cp /opt/backup/openssh_bak/sshd.bak /etc/pam.d/sshd echo -e ' Port 22 AddressFamily inet ListenAddress 0.0.0.0 Protocol 2 SyslogFacility AUTHPRIV PermitRootLogin yes MaxAuthTries 6 PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication yes PermitEmptyPasswords no UsePAM yes UseDNS no X11Forwarding yes Subsystem sftp /usr/libexec/openssh/sftp-server ' > /etc/ssh/sshd_config systemctl enable sshd systemctl restart sshd ssh -V 升级完 ssh -V OpenSSH_8.6p1, OpenSSL 1.1.1g FIPS 21 Apr 2020