openssl && openssh升级
先安装telnet
yum -y install wget gcc pam-devel libselinux-devel telnet-server telnet xinetd.x86_64 zlib zlib-devel openssl-devel
vim /etc/xinetd.conf
# disabled =
改成
\# disabled = no
vim /etc/securetty
xvc0
后面追加
pts/0
pts/1
pts/2
pts/3
pts/4
systemctl restart telnet.socket
systemctl restart xinetd.service
在开一个终端:
telnet 192.168.241.171(成功)
wget -O openssl-1.1.1j.tar.gz https://www.openssl.org/source/openssl-1.1.1k.tar.gz --no-check-certificate
微信传输openssh.tar.gz
升级openssl
chmod 600 /etc/ssh/ssh_host_*
cd openssl-1.1.1k/
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared
make -j2 &&make install
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
tar -xf openssl-1.1.0k.tar.gz
alias openssl=“/usr/bin/openssl”
echo “/usr/local/openssl/lib/”>>/etc/ld.so.conf
ldconfig
openssl version
升级openssh
chmod 600 /etc/ssh/ssh_host_*
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-zlib --with-tcp-wrappers --with-ssl-dir=/usr/local/openssl
make && make install
chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key
cp -rf contrib/redhat/sshd.init /etc/init.d/sshd
cp -rf contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod u+x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
mv /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/sshd.service.bak
systemctl daemon-reload
systemctl restart sshd
ssh -V
vim /etc/ssh/sshd_config
注释掉
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials no
#UsePAM yes
因为 centos7.4和centos7.5的环境变量是不一样的,可以查看echo $PATH
所以,升级后会发现,root 有 openssl 和 ssh的命令,而 普通用户没有,
解决办法:
chmod -R 755 /usr/local/
#################################################