欢迎来到科站长!

RedHat/Centos

当前位置: 主页 > 操作系统 > RedHat/Centos

Centos7.8怎么更新openssh? Centos升级openssh的技巧

时间:2024-08-12 19:47:17|栏目:RedHat/Centos|点击:

给大家分享一下Centos7.8如何更新安装openssh的经验。从版本7.4p1更新到9.4p1

安装telnet工具。(为了避免在升级的过程中断开)

#yum -y install telnet*

启用telnet服务

#systemctl enable telnet.socket
#systemctl start telnet.socket

关闭或者修改安全配置文件

注:(否则root无法telnet登录)

#mv /etc/securetty /etc/securetty.bak

使用telnet登录系统,准备升级Openssh

使用xftp工具上传更新包。

解压缩安装包

#tar -zxvf openssh-9.4p1.xx

切换至安装包目录,执行配置脚本。

# cd openssh-9.4p1-xx
# ./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/openssl

执行编译并编译安装

# make && make install

卸载原系统yum安装的openssh包

# yum remove openssh

在/etc目录下面新建ssh目录

# mkdir -p /etc/ssh

拷贝openssh安装目录下的配置文件至/etc/ssh目录下

# cp /usr/local/openssh/etc/* /etc/ssh/

编辑sshd_config配置文件

修改如图所示的三个地方,保存退出。

# vi /etc/ssh/sshd_config
#wq

复制文件到相应的系统文件夹

# cp /home/manager/openssh-9.4p1/contrib/redhat/sshd.init /etc/init.d/sshd
# cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd
# cp /usr/local/openssh/bin/ssh /usr/bin/ssh
# cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

添加sshd系统启动,并启动sshd服务

# chkconfig --add sshd
# systemctl start sshd.service

查看openssh 运行状态,并添加openssh 开机自启服务。

查看openssh和openssl 版本

# systemctl status sshd.service
# systemctl enable sshd.service
# ssh -V


上一篇:暂无

栏    目:RedHat/Centos

下一篇:Centos7.8怎么更新openssl? CentOS升级OpenSSL的技巧

本文标题:Centos7.8怎么更新openssh? Centos升级openssh的技巧

本文地址:https://fushidao.cc/system/642.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:1205677645 | 邮箱:1205677645@qq.com

Copyright © 2018-2024 科站长 版权所有冀ICP备14023439号