Linux 修改openssh版本信息

/////查找sshd的位置
# whereis sshd
/////备份sshd
# cp /usr/sbin/sshd /usr/sbin/sshd.bak.20200202
////搜索版本信息
# strings /usr/sbin/sshd | grep OpenSSH
  
OpenSSH_5.9p1
OpenSSH_5.9
OpenSSH_2.3.0*
OpenSSH_2.3.*
OpenSSH_2.5.3*
OpenSSH_3.*
OpenSSH_4*
OpenSSH*
OpenSSH-2.0*,OpenSSH-2.1*,OpenSSH_2.1*,OpenSSH_2.2*
OpenSSH_2.5.0p1*,OpenSSH_2.5.1p1*
OpenSSH_2.5.0*,OpenSSH_2.5.1*,OpenSSH_2.5.2*
OpenSSH_2.*,OpenSSH_3.0*,OpenSSH_3.1*
////替换版本信息
# sed -i 's/OpenSSH_5.9/OpenSSH_7.7/g' /usr/sbin/sshd
# service sshd restart
################################################
 
具体测试效果:
cp
/usr/sbin/sshd /usr/sbin/sshd.bak.20190909 strings /usr/sbin/sshd | grep OpenSSH sed -i 's/OpenSSH_7.2p2/OpenSSH_8.0p1/g' /usr/sbin/sshd service sshd restart
使用 telnet 或者 nmap 验证修改效果 telnet
127.0.0.1 22
nmap 127.0.0.1 -p 22

 

posted @ 2020-08-17 10:28  桑中子衿  阅读(1116)  评论(0编辑  收藏  举报