zoukankan      html  css  js  c++  java
  • CentOS connect:fail, reason: connect server 22 port fail

    当我们使用远程连接出现
    connect:fail, reason: connect server 22 port fail
    说明22端口被服务器关闭了,导致普通ROOT用户无法访问
    解决方法:
    1.打开阿里云控制台救援连接,(管理员连接)
    在这里插入图片描述

    2.输入连接密码,进入连接界面,输入登录用户名,密码(输入密码是不会显示的)
    第一步

    查看本机是否安装SSH软件包

    [root@localhost ~]# rpm -qa | grep ssh

    openssh-server-6.6.1p1-12.el7_1.x86_64

    openssh-clients-6.6.1p1-12.el7_1.x86_64

    libssh2-1.4.3-8.el7.x86_64

    openssh-6.6.1p1-12.el7_1.x86_64

    如果没有,则需要安装

    [root@localhost /]# yum install openssh-server

    第二步

    开启 SSH 服务

    [root@localhost ~]# service sshd start

    Redirecting to /bin/systemctl start sshd.service

    查看TCP 22端口是否打开

    [root@localhost ~]# netstat -ntpl | grep 22

    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 17816/sshd

    第三步(如果第二步之后仍旧无法连接)

    你可以将防火墙中的规则条目清除掉:
    [root@localhost ~]# iptables -F

    第四步:开机自启ssh
    通过chkconfig自启动ssh
    chkconfig -- level 3 sshd on

  • 相关阅读:
    pycharm远程SSH调用服务器python解释器教程
    SVN自动生成版本号信息
    gtest运行小析
    记一次问题排查心得
    Effective STL读书笔记
    模板单例实现
    NetLimiter网速测试小坑
    客户端升级项目小结
    长训总结
    科目二心得体会
  • 原文地址:https://www.cnblogs.com/nmydt/p/14494124.html
Copyright © 2011-2022 走看看