标签:syn res ini $? 安装 解压 start local kconfig
cd /opt && wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.6p1.tar.gz
yum install -y gcc zlib-devel openssl-devel pam-devel libselinux-devel
tar xf /opt/openssh-8.6p1.tar.gz && rm -f openssh-8.6p1.tar.gz
chmod -R root.root openssh-8.6p1
rsync -av /etc/ssh /etc/ssh.bak
rsync -av /usr/bin/ssh /usr/bin/ssh.bak
rsync -av /usr/sbin/sshd /usr/sbin/sshd.bak
rsync -av /etc/ssh/ssh_config /etc/ssh/ssh_config.d ~/
rsync -av /etc/crypto-policies/back-ends/openssh.config ~/
rsync -av /etc/ssh/sshd_config ~
rsync -av ~/.ssh/authorized_keys ~/.ssh/authorized_keys.bak
cd openssh-8.6p1/
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl --without-hardening
echo $? #如果为0,则成功
make && make install
echo $? #如果为0,则成功
chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key
#修改配置文件
rsync -av ~/ssh_config /etc/ssh/ssh_config
rsync -av ~/ssh_config.d /etc/ssh/ssh_config.d
rsync -av ~/sshd_config /etc/ssh/sshd_config
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod u+x /etc/init.d/sshd
mv /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/sshd.service.bak
chkconfig --add sshd
chkconfig sshd on
systemctl daemon-reload
systemctl restart sshd
ssh -V
标签:syn res ini $? 安装 解压 start local kconfig
原文地址:https://www.cnblogs.com/fangweiming/p/14871427.html