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
相关推荐
物理与数学几秒前
linux 内核memblock
linux·linux内核
4t4run13 分钟前
28、Linux 系统定时任务
linux·运维·服务器
~黄夫人~24 分钟前
Ansible 自动化运维:从 “手动输密码” 到 “一键免密管理”
linux·运维·自动化·ansible
cui__OaO30 分钟前
Linux驱动--基于驱动设备分离的按键中断驱动
linux·运维·服务器·嵌入式
星期五不见面1 小时前
虚拟机使用外部WPN网络
linux
OnlyEasyCode1 小时前
Linux下载Navicat、特定版本Mysql
linux·运维·服务器
宇宙帅猴1 小时前
【Ubuntu踩坑及解决方案(一)】
linux·运维·ubuntu·go
济6172 小时前
linux 系统移植(第七期)----U-Boot 图形化配置及其原理-- Ubuntu20.04
linux·运维·服务器
_Xiaosz2 小时前
Photo-SLAM / ORB-SLAM3 编译报错解决:undefined reference to DUtils::Random
linux·ubuntu
kida_yuan2 小时前
【Linux】文件系统与 fsck.ext4 修复 - 我踩过的坑与总结
linux·运维·网络