Linux 升级Openssh8.0p1 和 Openssl1.0.2r的小插曲

Linux 升级Openssh8.0p1 和 Openssl1.0.2r的小插曲

先把我升级的命令发出来,用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相关命令就报错如图 其他用户不受影响

很崩溃,弄了很久 网上都说 有两个版本ssh 用户环境变量不正确,

在这里插入图片描述
可是我用whereis ssh whereis ssl 发现路径与其他用户都是一样的 环境变量中并没有配置,

最终解决方案

查了很多资料,最终判断还是由于路径原因,但是在哪,因为对ssh不熟找了很久

我们都知道 /etc/init.d/sshd 这个文件
我没想到的是里面竟然有sshd的路径
在这里插入图片描述
修改为正常的路径,服务正常

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值