• JumpServer报“认证失败 Authentication Error”小案例分析


    在JumpServer里面跳转到一台MySQL服务器时,出现下面错误认证失败 Authentication Error

     

    Opt or ID>: 5
     
    Only match Host:  xxxx 
     
    Connecting xxxx ...
     
    认证失败 Authentication Error.

     

    首先检查JumpServer的日志 /opt/jumpserver/logs/jumpserver.log,发现下面一些日志信息

     

    2020-06-23 15:43:15,581 - connect.py - DEBUG - {'ip': u'192.168.xxx.xxx', 'role_name': u'xxxxx', 'role_key': u'/opt/jumpserver/keys/user/xxxxx_xxxxx.pem', 'user': <User: xxxxx>, 'role_pass': 'xxxxx', 'port': 22, 'asset': <Asset: 192.168.xxx.xxx>}
     
    2020-06-23 15:43:17,815 - connect.py - WARNING - 使用ssh key /opt/jumpserver/keys/user/xxxxx_xxxxx.pem 失败, 尝试只使用密码

     

    然后从控制台登录那台需要连接的服务器上,看到如下所示日志信息

     

    Jun 23 16:02:12 xxxxx sshd[24534]: User xxxxx from xxxxx not allowed because not listed in AllowUsers

    Jun 23 16:02:12 xxxxx sshd[24535]: input_userauth_request: invalid user xxxxx

    Jun 23 16:02:12 xxxxx sshd[24534]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxxx  user=xxxxx

    Jun 23 16:02:14 xxxxx sshd[24534]: Failed password for invalid user xxxxx from xxxxx port 54441 ssh2

    Jun 23 16:02:14 xxxxx sshd[24536]: User xxxxx from xxxxx not allowed because not listed in AllowUsers

    Jun 23 16:02:14 xxxxx sshd[24537]: input_userauth_request: invalid user xxxxx

    Jun 23 16:02:14 xxxxx sshd[24536]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxxx  user=xxxxx

    Jun 23 16:02:16 xxxxx sshd[24536]: Failed password for invalid user xxxxx from xxxxx port 54445 ssh2

    Jun 23 16:02:16 xxxxx sshd[24537]: Connection closed by xxxxx

    Jun 23 16:02:16 xxxxx sshd[24535]: Connection closed by xxxxx

     

    检查 /etc/ssh/sshd_config,发现JumpServer服务器的IP地址被注释了。应该是某个时候,粗心大意给释掉的。然后就出现了这一幕,从JumpServer跳转到这台服务器时报认证失败 Authentication Error

     

    #AllowUsers *@192.168.xxx.xxx

     

    解决方法取消JumpServer主机的注释重启sshd服务。问题解决。

     

  • 相关阅读:
    MVC HtmlHelper用法大全
    mysql查询结果输出到文件
    未能加载文件或程序集“Autofac, Version=3.4.0.0,
    IHttpModule接口
    演练:创建和注册自定义 HTTP 模块
    Tablespace for table '`pomelo`.`bag`' exists. Please DISCARD the tablespace before IMPORT.
    java开发知识IO知识之输入输出流以及文件
    Java开发知识之Java中的Map结构
    Java开发知识之Java中的集合Set接口以及子类应用
    Java开发知识之Java中的集合上List接口以及子类讲解.
  • 原文地址:https://www.cnblogs.com/kerrycode/p/13182923.html
Copyright © 2020-2023  润新知