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
相关推荐
sulikey43 分钟前
个人Linux操作系统学习笔记2 - gcc与库的理解
linux·笔记·学习·操作系统·gcc·
二宝哥1 小时前
Linux虚拟机网络配置
linux·运维·服务器
陳10301 小时前
Linux:进程间通信 和 简单进程池
linux·运维·服务器
jimy12 小时前
改.bashrc,直观地判断本地repo是否有改动
linux·服务器
愚昧之山绝望之谷开悟之坡2 小时前
什么是Linter?什么是沙箱!
linux·笔记
babytiger3 小时前
Gitea 重安装 + Snap 数据迁移完整流程总结
linux·elasticsearch·gitea
匆匆那年9673 小时前
远程 Linux 校园网认证操作手册(本地浏览器法)
linux·运维·服务器
newnazi3 小时前
RedHat10 安装MS SQL Server2025
linux·服务器·数据库
zkkkkkkkkkkkkk4 小时前
Linux进行管理工具Supervisor配置与使用
linux·python·supervisor
开发者联盟league4 小时前
linux普通用户使用pip安装模块
linux·python·pip