Centos7.8更新openssh

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

工具/原料

    HPBookPro14

    Centos7.8

方法/步骤

    1

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

    #yum -y install telnet*

    Centos7.8更新openssh

    2

    启用telnet服务

    #systemctl enable telnet.socket

    #systemctl start telnet.socket

    Centos7.8更新openssh

    3

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

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

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

    Centos7.8更新openssh

    4

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

    Centos7.8更新openssh

    5

    使用xftp工具上传更新包。

    Centos7.8更新openssh

    6

    解压缩安装包

    #tar -zxvf openssh-9.4p1.xx

    Centos7.8更新openssh

    7

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

    # cd openssh-9.4p1-xx

    # ./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/openssl

    Centos7.8更新openssh

    8

    执行编译并编译安装

    # make && make install

    Centos7.8更新openssh

    9

    卸载原系统yum安装的openssh包

    # yum remove openssh

    Centos7.8更新openssh

    10

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

    # mkdir -p /etc/ssh

    11

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

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

    Centos7.8更新openssh

    12

    编辑sshd_config配置文件

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

    # vi /etc/ssh/sshd_config

    #wq

    Centos7.8更新openssh

    13

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

    # 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

    Centos7.8更新openssh

    14

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

    # chkconfig --add sshd

    # systemctl start sshd.service

    Centos7.8更新opensshCentos7.8更新openssh

    15

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

    查看openssh和openssl 版本

    # systemctl status sshd.service

    # systemctl enable sshd.service

    # ssh -V

    Centos7.8更新opensshCentos7.8更新opensshCentos7.8更新opensshEND

注意事项

    本步骤操作的前提:已经升级了系统openssl版本,应openssh依赖于openssl的原因,必须先升级openssl

温馨提示:经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
免责声明:本文转载来之互联网,不代表本网站的观点和立场。如果你觉得好欢迎分享此网址给你的朋友。
转载请注明出处:https://www.baikejingyan.net/af56bUG8CAQVRCw.html

打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023年08月29日
下一篇 2023年08月29日
single-end

热门经验

single-end

相关经验

联系我们

在线咨询: QQ交谈

邮件:baikejingyan@gmail.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信