Skip to main content
  1. Documentation/

Upgrade openssh version 9.0 on centos7

200 words·1 min
Linux
Table of Contents

Upgrade OpenSSH to 9.0 on CentOS
#

Install the software packages required for compilation:

yum install -y wget gcc pam-devel libselinux-devel zlib-devel openssl-devel/Users/kiga/WorkSpace/backend/README.md

download openssh install pakage

cd /usr/local/src
wget -O openssh.tar.gz https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz

Backup configuration files. Generally, when uninstalling, the configuration files will be saved as sshd_config.rpmsave. However, the /etc/pam.d/sshd configuration file is not saved separately, so it is recommended to backup all

cp /etc/ssh/sshd_config sshd_config.backup
cp /etc/pam.d/sshd sshd.backup

Remove the lower version OpenSSH rpm package, not necessary

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

Install openssh
#

decompress

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

configure

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

compile and install

make && make install

permissions
#

adjust file permissions

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

copy configuration files

cp -a contrib/redhat/sshd.init /etc/init.d/sshd
chmod u+x /etc/init.d/sshd

restore configuration files

mv ../sshd.backup /etc/pam.d/sshd
mv ../sshd_config.backup /etc/ssh/sshd_config

add the ssh service to the start up items for automatics startup

chkconfig --add sshd
chkconfig sshd on

restart ssh service

systemctl restart sshd

Verify the results
#

# ssh -V
OpenSSH_9.0p1, OpenSSL 1.0.2k-fips  26 Jan 2017

Centos can ping but cannot ssh
#

sudo systemctl restart sshd

sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --reload

sudo setenforce 0

Related

Linux 基础配置及命令行操作
585 words·3 mins
Linux
免密登录配置 # 生成公钥、私钥
PAGECACHE、DENTRIES、INODES
360 words·2 mins
Kiga-Hub
Linux Linux
/proc # /proc 是一个虚拟文件系统,通过对它的读写操作做为与Kernel实体间进行通信的一种手段 通过修改/proc中的文件,来对当前kernel的行为作出调整
Interview
1686 words·8 mins
Post
Summarize # 主要语言栈golang,主要技术方微服务开发。 有微服务实践经历,了解cicd流程,求职意向基础架构研发、运维研发之类的(主要还是研发方向)。
Finite State Transducer
365 words·2 mins
Note
FST # FST是一种有限状态自动机,可以用来存储和快速查找字符串集合。
简单实现QPS计算
280 words·2 mins
Golang
Simple QPS # 实现一个简单的QPS(每秒查询率)测试。