centOS6.5升级ssl

先安装 telnet, 可以远程连接 linux。 防止ssl升级失败,无法连接。

centOS 6.5关闭防火墙步骤

临时关闭命令:
service iptables stop
永久关闭防火墙:chkconfig iptables off

运行完成后查看防火墙关闭状态
service iptables status


centOS 7 关闭防火墙步骤
//临时关闭
systemctl stop firewalld
//禁止开机启动
systemctl disable firewalld

升级openssh
备份
cp -raf /etc/ssh /etc/ssh.old
cp -raf /etc/init.d/sshd /etc/init.d/sshd.old
cp -raf /root/.ssh /root/.ssh.old


./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-ssl-dir=/usr/local/ssl/ --with-privsep-path=/var/empty/sshd

make
make完成后先不要make install,先卸载旧版的openssh
rpm -e --nodeps `rpm -qa | grep openssh`

提示
warning: /etc/ssh/sshd_config saved as /etc/ssh/sshd_config.rpmsave

make install
提示:
/etc/ssh/ssh_config already exists, install will not overwrite
/etc/ssh/moduli already exists, install will not overwrite
ssh-keygen: generating new host keys: ECDSA ED25519
/usr/sbin/sshd -t -f /etc/ssh/sshd_config


3、配置sshd服务:
复制启动文件到/etc/init.d/下并命名为sshd:
[root@bogon openssh-7.5p1]# cp contrib/redhat/sshd.init /etc/init.d/sshd
加入开机启动:
[root@bogon openssh-7.5p1]# chkconfig --add sshd
4、配置允许root使用ssh:
openssh7.5默认root用户是不能用ssh远程登录的,需要修改配置文件:
[root@bogon openssh-7.5p1]# vim /etc/ssh/sshd_config
添加如下代码PermitRootLogin yes 重启ssh服务:

重启
service sshd restart

posted @ 2018-09-10 10:39  wujinfeng  阅读(389)  评论(0)    收藏  举报