-
首先,创建一个用户组:
groupadd sshuser
-
vi /etc/pam.d/sshd
auth required pam_sepermit.so
auth include password-auth
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
添加:
auth required pam_listfile.so item=group sense=allow file=/etc/security/allow-groups
编辑:
vi /etc/security/allow-groups加入sshuser
上面的配置没有生效,继续找原因。。。。
本文转自chenzudao51CTO博客,原文链接: http://blog.51cto.com/victor2016/1901181,如需转载请自行联系原作者