echo '/usr/local/ssl-3.3.1/lib64' >> /etc/ld.so.conf ldconfig -v openssl version
# 安装zlib-1.3.1 tar -xf zlib-1.3.1.tar.gz cd ./zlib-1.3.1 ./configure --prefix=/usr/local/zlib-1.3.1 make && make install chmod 600 /etc/ssh/ssh_host_rsa_key chmod 600 /etc/ssh/ssh_host_ed25519_key chmod 600 /etc/ssh/ssh_host_ecdsa_key
# 安装openssh-9.8p1
tar -xf openssh-9.8p1.tar.gz cd openssh-9.8p1 ./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/ssl-3.3.1/include --with-ssl-dir=/usr/local/ssl-3.3.1 --with-zlib=/usr/local/zlib-1.3.1 --with-md5-passwords --with-pam cp -r /etc/ssh /etc/ssh_${now} # make 报错的话执行以下命令 #autoreconf make && make install
sed -i '/X11Forwarding/s/#X11Forwarding yes/X11Forwarding yes/' /etc/ssh/sshd_config sed -i '/PermitRootLogin/s/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i '/UseDNS/s/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config echo "KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1" >> /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