zoukankan      html  css  js  c++  java
  • Xshell连接linux服务器不成功的乌龙问题

    一般xshell连接linux服务器不成功有以下几个问题:

    • linux防火墙拦截,导致Xshell不能访问linux

        操作方法:

         firewalld(CentOS7):启动 :systemctl start firewalld

                   关闭:systemctl stop firewalld

                   查看状态:systemctl status firewalld

                   开机禁用:systemctl disable firewalld

                   开机启用:systemctl enable firewalld

         iptables防火墙的操作方法与firewalld防火墙相同,只是在不同环境下可能需要将 systemctl 换成service

    • 22端口被占用

        查看方法:netstat -tunlp|grep 22   查看端口使用情况

             lsof -i:22  查看端口属于哪一个程序

             如果不是sshd进程的话  则  kill -9 进程id  杀死进程

    • 修改sshd_config配置文件

        用root权限打开  /etc/ssh/sshd_config文件

        修改  PermitRootLogin no  改为 PermitRootLogin yes

        之后重启服务  service sshd restart 

    笔者执行完以上三种方式扔仍没有解决问题,最后发现在登录linux虚拟机时输入的密码是按的键盘右侧的数字键。因为当时的数字键是锁定的状态,输入时并不是输入的空,而是其他字符,导致root密码根本就不是自己记录的密码。所以当在xshell里面输入密码时因为密码错误登录不上。

    因为这个问题耽误了两天的时间,实在是乌龙,记录在册,希以鞭策。

          

  • 相关阅读:
    HTTP请求报文
    NSInteger和int分别在什么时候使用
    iOS开发之一些字符串常用的代码
    NSTimer用法
    property 'count' not found on object of type 'NSMutableArray
    详解MAC硬盘中各个文件夹
    如何在Mac下显示Finder中的所有文件
    xcode运行时出现attaching to
    ios sandbox
    使用sqlite存取数据
  • 原文地址:https://www.cnblogs.com/wawjandcsws/p/10262586.html
Copyright © 2011-2022 走看看