Skip to content

Instantly share code, notes, and snippets.

@yut148
Created March 26, 2013 08:49
Show Gist options
  • Save yut148/5243974 to your computer and use it in GitHub Desktop.
Save yut148/5243974 to your computer and use it in GitHub Desktop.
CentOS6.3 use PAM access control /etc/pam.d/sshd
cat /etc/pam.d/sshd
#%PAM-1.0
auth required pam_sepermit.so
auth include password-auth
#追加
account required pam_access.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 optional pam_keyinit.so force revoke
session include password-auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment