升级openssl和openssh

安装升级openssl

cd openssl-1.1.1h
./config --prefix=/usr --shared && make && make install
echo $?
openssl version

安装升级openssh

cd openssh-8.4p1
./configure --prefix=/usr/ --sysconfdir=/etc/ssh  --with-zlib --with-md5-passwords --with-pam && make && make install
echo $?
ssh  -V

配置bak

mv /etc/init.d/sshd /etc/init.d/sshd.old
cp ./contrib/redhat/sshd.init /etc/init.d/sshd     复制启动文件
chkconfig --add sshd     添加卡机启动脚本
chkconfig sshd on     设置开机启动
chkconfig --list|grep sshd     查看设置结果
ssh -V     查看版本号是否成功
sed -i "32 aPermitRootLogin yes" /etc/ssh/sshd_config     允许root使用密码登录,默认不允许
sed -i "12 aPort 22" /etc/ssh/sshd_config
chmod 600 /etc/ssh/ssh_host_ed25519_key
service sshd restart     重启ssh的服务,可以ssh登录了

关闭telnet:

mv /etc/securetty.bak /etc/securetty
chkconfig  xinetd off
service xinetd stop
service iptables start
chkconfig iptables on

注意 默认端口22,防火墙关闭,开启telnet23端口

posted @ 2020-12-08 08:47  alive-dead-man  阅读(95)  评论(0)    收藏  举报