先把我升级的命令发出来,用7.9的改的 没什么技术含量
which openssl
cd /tmp/
vim /etc/xinetd.d/telnet
service xinetd restart
netstat -tnl |grep 23
iptables -I INPUT -p tcp --dport 23 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
service iptables save
service iptables restart
cp -rf /etc/ssh /etc/ssh.bak20190521
tar zxvf openssl-1.0.2r.tar.gz
cd /tmp/openssl-1.0.2r
openssl version
mv /usr/bin/openssl /usr/bin/openssl_bak
mv /usr/include/openssl /usr/include/openssl_bak
./config shared && make && make install
echo $?
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo “/usr/local/ssl/lib” >> /etc/ld.so.conf
/sbin/ldconfig
openssl version
cd …
tar zxvf openssh-8.0p1.tar.gz
chown -R root.root /tmp/openssh-8.0p1
cd /tmp/openssh-8.0p1
rm -rf /etc/ssh/*
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-openssl-includes=/usr/local/ssl/include
–with-ssl-dir=/usr/local/ssl --with-zlib --with-md5-passwords --with-pam && make && make install
echo $?
cp -irf contrib/redhat/sshd.init /etc/init.d/sshd
cp -rf contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
cp -rf /usr/local/bin/ssh /usr/bin/ssh
cp -rf /usr/local/bin/sftp /usr/bin/sftp
cp -rf /usr/local/bin/scp /usr/bin/scp
chmod 755 /usr/bin/ssh
chmod 755 /usr/bin/sftp
chmod 755 /usr/bin/scp
chmod +x /etc/init.d/sshd
chkconfig --add sshd
mv /usr/lib/systemd/system/sshd.service /tmp/
chkconfig sshd on
ssh -V
echo ‘PermitRootLogin yes’ >> /etc/ssh/sshd_config
echo ‘UseDNS no’ >> /etc/ssh/sshd_config
echo ‘X11Forwarding yes’ >> /etc/ssh/sshd_config
grep “^PermitRootLogin” /etc/ssh/sshd_config
grep “UseDNS” /etc/ssh/sshd_config
grep “X11Forwarding” /etc/ssh/sshd_config
chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd
vim /etc/ssh/sshd_config
Subsystem sftp internal-sftp
service sshd restart
service xinetd stop
结果报错
这个用户只要运行ssh相关命令就报错如图 其他用户不受影响
很崩溃,弄了很久 网上都说 有两个版本ssh 用户环境变量不正确,
可是我用whereis ssh whereis ssl 发现路径与其他用户都是一样的 环境变量中并没有配置,
最终解决方案
查了很多资料,最终判断还是由于路径原因,但是在哪,因为对ssh不熟找了很久
我们都知道 /etc/init.d/sshd 这个文件
我没想到的是里面竟然有sshd的路径
修改为正常的路径,服务正常