赞
踩
yum install pam-devel -y
如果没有安装此依赖,在编译配置步骤会发生以下报错
(1)点击链接: openssh-9.1p1进行下载
如需其他版本地址:https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/?spm=a2c6h.25603864.0.0.6ff47250yWHrrz
(2)新建openssh目录,用于存放openssh-9.1p1压缩包,我放在了/root/openssh 目录下
mkdir openssh
cd openssh/
(3)备份配置文件
cp /etc/ssh/sshd_config /home/sshd_config.backup
cp /etc/pam.d/sshd /home/sshd.backup
(4)删除旧版本的OpenSSH
rpm -e --nodeps `rpm -qa | grep openssh`
(1)解压openssh
cd /root/openssh/
tar -zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1
(2)编译配置
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-tcp-wrappers --with-ssldir=/usr/local/ssl --without-hardening
(3)编译安装
make && make install
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
cd /root/openssh/openssh-9.0p1
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
chmod u+x /etc/init.d/sshd
(1)还原之前的配置文件
mv /home/sshd.backup /etc/pam.d/sshd
mv /home/sshd_config.backup /etc/ssh/sshd_config
(2)修改/etc/ssh/sshd_config配置文件
vim /etc/ssh/sshd_config
chkconfig --add sshd
chkconfig sshd on
systemctl restart sshd
ssh -V
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。