tar xf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g
./config shared zlib --openssldir=/usr/local/openssl --prefix=/usr/local/openssl
make && make install
备份旧的openssl
mv /usr/bin/openssl /usr/bin/openssl.old
# mv /usr/include/openssl /usr/include/openssl.old
创建新版本链接
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
# ln -s /usr/local/openssl/include/openssl /usr/include/openssl
这是由于openssl库的位置不正确造成的,解决办法:
# ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
# ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v
yum -y install pam-devel tcp-wrappers-devel
mv /etc/ssh /etc/ssh.old
tar xf openssh-8.3p1.tar.gz
cd openssh-8.3p1
install -v -m700 -d /var/lib/sshd
chown -v root.sys /var/lib/sshd
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/openssl/ --without-hardening --with-zlib
make && make install
install -v -m755 contrib/ssh-copy-id /usr/bin/
install -v -m 644 contrib/ssh-copy-id.1 /usr/share/man/man1
install -v -m755 -d /usr/share/doc/openssh-8.3p1
install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.3p1/
sed 's@d/login@d/sshd@g' /etc/pam.d/login > /etc/pam.d/sshd
chmod 644 /etc/pam.d/sshd
cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
systemctl enable sshd
systemctl restart sshd
vim /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes