centos8 升级openssh-9.8p1

bash 复制代码
mv /etc/ssh /etc/ssh.bak
cd /usr/local/src/openssh-9.1p1/
./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-zlib=/usr/local/zlib

make -j 4 && make install

echo "X11Forwarding yes" >> /etc/ssh/sshd_config
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config                
echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
echo "UseDNS no" >> /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config

#备份ssh文件:
mv /usr/sbin/sshd /usr/sbin/sshd.bak
cp -rf /usr/local/openssh/sbin/sshd /usr/sbin/sshd
mv /usr/bin/ssh /usr/bin/ssh.bak
cp -rf /usr/local/openssh/bin/ssh /usr/bin/ssh 
mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
cp -rf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
  • 查看ssh版本
bash 复制代码
ssh -V
  • 重启SSH服务并加入自启
bash 复制代码
systemctl stop sshd.service
rm -rf /lib/systemd/system/sshd.service 
systemctl daemon-reload
cp /usr/local/src/openssh-9.1p1/contrib/redhat/sshd.init /etc/init.d/sshd
/etc/init.d/sshd restart
systemctl status sshd

chkconfig --add  sshd
chkconfig --list sshd
相关推荐
十年磨一剑~7 分钟前
Linux程序接收到sigpipe信号崩溃处理
linux
geshifei13 分钟前
Sched ext回调3——select_cpu(linux 6.15.7)
linux·ebpf
代码游侠38 分钟前
C语言核心概念复习——网络协议与TCP/IP
linux·运维·服务器·网络·算法
你真是饿了40 分钟前
6.库制作与原理
linux·服务器
Zach_yuan2 小时前
深入浅出 JSONCpp
linux·服务器·网络·c++
北京迅为3 小时前
《【北京迅为】itop-3568开发板NPU使用手册》- 第 7章 使用RKNN-Toolkit-lite2
linux·人工智能·嵌入式·npu
Dragon~Snow3 小时前
Linux Centos9 安装 Elasticsearch
linux·elasticsearch·jenkins
熊延3 小时前
麒麟V10系统安装部署elasticsearch
linux·运维·服务器·elasticsearch·搜索引擎·全文检索
Jia ming3 小时前
跟踪器与事件使用举例
linux·事件·跟踪器
生活很暖很治愈3 小时前
Linux——基础IO&软硬链接
linux·ubuntu