centos7升级openssh-8.0p1 openssh-8

1、依赖安装

yum -y install gcc gcc-c++;

yum install openssl-devel;

yum -y install pam-devel;

yum install zlib-devel;

 

2、进入到openssh8解压目录中

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-openssl-includes=/usr --with-privsep-path=/var/lib/sshd;

 

make && make install;

 

3、复制文件及授权

install -v -m755 contrib/ssh-copy-id /usr/bin;

install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1;

install -v -m755 -d /usr/share/doc/openssh-8.0p1;

install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.0p1;

 

4、设置文件权限

chmod 640 /etc/ssh/ssh_host_rsa_key;

chmod 640 /etc/ssh/ssh_host_ecdsa_key;

chmod 640 /etc/ssh/ssh_host_ed25519_key;

chmod 620 /etc/ssh/moduli ;

chmod 600 /etc/ssh/sshd_config /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_rsa_key;

chmod 644 /etc/ssh/ssh_config /etc/ssh/ssh_host_dsa_key.pub /etc/ssh/ssh_host_rsa_key.pub;

chmod 600 /etc/ssh/ssh_host_ecdsa_key;

chmod 600 /etc/ssh/ssh_host_ed25519_key;

 

5、设置root用户远程连接

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config;

 

6、设置ssh服务开机启动

cp -p contrib/redhat/sshd.init /etc/init.d/sshd;

chmod +x /etc/init.d/sshd;

chkconfig --add sshd;

chkconfig sshd on;

/etc/init.d/sshd restart;

 

7、检查服务状态

systemctl start sshd;

systemctl status sshd;

journalctl -xe;

 

sshd -t

没有任何打印,代表服务安装完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值