创建用户之后,使用ssh协议登陆提示失败。

useradd -d /home/hdp -m hdp -g dba -s /bin/bash

 

通过命令

ssh -v hdp@127.0.0.1 登陆,查看debug日志,没有发现问题。

 

查看linux系统日志:

vi /var/log/message

看到提示如下错误:

Aug 6 18:46:25 rac4 sshd[12436]: User hdp from 10.16.11.61 not allowed because not listed in AllowUsers
Aug 6 18:46:27 rac4 sshd[12436]: error: PAM: Authentication failure for illegal user hdp from 10.16.11.61
Aug 6 18:46:27 rac4 sshd[12436]: Failed keyboard-interactive/pam for invalid user hdp from 10.16.11.61 port 57018 ssh2

于是知道用户不在AllowUsers导致登陆失败。

 

修改配置:

vi /etc/ssh/sshd_config

将用户hdp加入到

AllowUsers root acrosspm mos5200 hdp

 

重启ssh服务:

在/etc/init.d下运行service sshd restart

 

登陆即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-01-05
  • 2022-12-23
  • 2021-12-08
  • 2021-10-16
  • 2021-07-15
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案