我需要允许域用户(用户ID和密码)访问Centos 7服务器以及本地用户(SSH密钥/无密码).
我已经使用AllowUsers和AllowGroups配置了sshd_config,并假设如果我将本地用户添加到它应该工作的那些用户.
但是,当本地用户尝试登录时,我收到错误:
我已经使用AllowUsers和AllowGroups配置了sshd_config,并假设如果我将本地用户添加到它应该工作的那些用户.
但是,当本地用户尝试登录时,我收到错误:
sshd[23906]: pam_sss(sshd:account): Access denied for user datahub_push: 10 (User not known to the underlying authentication module) sshd[23906]: fatal: Access denied for user datahub_push by PAM account configuration [preauth]
域用户工作正常,并在sshd_config中的AllowGroups下有一个条目.
经过一些谷歌搜索后,有一个建议,我需要修改:
/etc/pam.d/sshd
…但我不确定要改变什么以及编辑该文件是否是最佳做法?即我应该使用authconfig工具.
任何帮助非常感谢.
我自己修好了!
我添加了以下行
我添加了以下行
/etc/pam.d/sshd
account sufficient pam_localuser.so
重新启动到sshd后,我现在可以以域用户和本地用户身份登录.这是完整的工作文件:
#%PAM-1.0 auth required pam_sepermit.so auth substack password-auth auth include postlogin # Used with polkit to reauthorize users in remote sessions -auth optional pam_reauthorize.so prepare account sufficient pam_localuser.so account required pam_nologin.so account include password-auth password include password-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open env_params session required pam_namespace.so session optional pam_keyinit.so force revoke session include password-auth session include postlogin # Used with polkit to reauthorize users in remote sessions -session optional pam_reauthorize.so prepare
希望这可以帮助别人:)