前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >OpenSSH升级版本到最新(8.4)

OpenSSH升级版本到最新(8.4)

原创
作者头像
硅谷子
修改2020-12-22 10:48:57
21.2K25
修改2020-12-22 10:48:57
举报
文章被收录于专栏:BigdataBigdata

1、依赖软件包:

yum install wget gcc -y
yum install -y zlib-devel openssl-devel 
yum install pam-devel libselinux-devel zlib-devel openssl-devel -y 

2、下载安装包OpenSSH8.4上传至服务器或wget直接下载

wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz

3、删除低版本OpenSSH的的rpm包

rpm -e --nodeps `rpm -qa | grep openssh` 

4、安装openssh

(1).解压

tar -zxvf openssh-8.4p1.tar.gz
cd  openssh-8.4p1

(2).配置

 ./configure   --prefix=/usr   --sysconfdir=/etc/ssh    --with-md5-passwords   --with-pam --with-zlib   --with-tcp-wrappers    --with-ssl-dir=/usr/local/ssl   --without-hardening

(3).编译安装

make
make install

(4)赋权

chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key

(5)复制配置文件并设置允许root用户远程登录

cp -a contrib/redhat/sshd.init  /etc/init.d/sshd
cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod u+x /etc/init.d/sshd
vim /etc/ssh/sshd_config 

1.修改#PermitRootLogin prohibit-password项,去掉注释#并把prohibit-password改为yes,修改后即为PermitRootLogin yes

2.去掉注释#PasswordAuthentication yes变为PasswordAuthentication yes

(6)添加添加自启服务ssh到开机启动项

chkconfig --add sshd
chkconfig sshd on

(7)重启服务

systemctl restart sshd

(8)查看下安装结果:

ssh -V

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档