opensshによる8.3バージョン履歴の保持へのアップグレード

   rpm -qa | grep openssh 
   vi / etc / ssh / sshd_config PasswordAuthentication yes PermitRootLogin yes 
   systemctl restart sshdを
   
   インストールしてtelnetサービスインストールします。telnetip を使用して直接マシンにログインし(通常のユーザーを使用する必要があります)、
   sshアップグレードが利用できず、マシンにログインできないようにします
   yum install -y telnet -server 
   yum install -y xinetd 
   systemctl start telnet.socket 
   systemctl start xinetd echo'pts 
   / 0 '>> / etc / securetty 
   echo'pts 
   / 1' >> / etc / securetty systemctl restart telnet.socket 
   yum install telnet.x86_64 
   exit 
   useradd test 
   passwd test 
   exit 
   別のマシンを検索して、telnet IPが正常にログインできるかどうかをテストします
   
   openssl-8.3インストールパッケージをダウンロードします
   cd / home / 
   ll
   mkdir sshpackage 
   cd sshpackage / 
   ll 
   wget http://www.zlib.net/zlib-1.2.11.tar.gz 
   wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz 
   wget http ://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.3p1.tar.gz 
   ls -l 
   rm -f openssh-8.3p1.tar.gz 
   ll 
   rz 
   ll 
   
   解压编译zlib-1.2.11 
   tar zxf zlib-1.2.11.tar.gz  
   ll 
   cd zlib-1.2.11 / 
   ./configure --prefix = / usr / local / zlib 
   make && make install 
   
   解压编译openssl-1.1.1g 
   tar -xvf openssl-1.1.1g .tar.gz 
   cd .. 
   ll 
   tar -xvf openssl-1.1.1g.tar.gz 
   cd openssl-1.1.1g / 
   ./config --prefix = / usr / local / ssl -d shared 
   make && make install 
   echo '/ usr / local / ssl / lib' >> /etc/ld.so.conf 
   ldconfig -v  
   cd .. 
   
   解压编译openssh -8.3p1 
   tar -xvf openssh-8.3p1.tar.gz 
   cd openssh-8.3p1 / 
   ./configure --prefix = / usr / local / openssh --with-ssl-dir = / usr / local / ssl --with -zlib = / usr / local / zlib 
   make && make install 
   
   修改配置
   vi / usr / local / openssh / etc / sshd_config PasswordAuthentication yes PermitRootLogin yes 
   
   备份升级替换ssh 
   mv / etc / ssh / sshd_config /etc/ssh/sshd_config.bak 
   cp / usr / local / openssh / etc / sshd_config / etc / ssh / sshd_config 
   mv / usr / sbin / sshd /usr/sbin/sshd.bak
   cp / usr / local / openssh / sbin / sshd / usr / sbin / sshd  
   mv / usr / bin / ssh /usr/bin/ssh.bak
   cp / usr / local / openssh / bin / ssh / usr / bin / ssh 
   mv / usr / bin / ssh-keygen / usr / bin / ssh- keygen.bak 
   cp / usr / local / openssh / bin / ssh-keygen / usr / bin / ssh-keygen 
   mv /etc/ssh/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub.bak 
   cp / usr / local / openssh /etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub 
   systemctl restart sshd 
   ssh -V 
   
   一切正常後に重新登録关闭telnet 
   服务systemctl stop telnet.socket 
   systemctl stop xinetd


おすすめ

転載: blog.51cto.com/superleedo/2535233