* Support LDAP authentication.
* Factor out the common parts of the PAM config files. svn path=/nixos/trunk/; revision=7694
This commit is contained in:
parent
554ae9908b
commit
07506308d6
@ -75,7 +75,7 @@ import ../helpers/make-etc.nix {
|
||||
(program:
|
||||
{ source = pkgs.substituteAll {
|
||||
src = ./etc/pam.d + ("/" + program);
|
||||
inherit (pkgs) pam_unix2;
|
||||
inherit (pkgs) pam_unix2 pam_ldap;
|
||||
};
|
||||
target = "pam.d/" + program;
|
||||
}
|
||||
@ -88,6 +88,10 @@ import ../helpers/make-etc.nix {
|
||||
"shadow"
|
||||
"sshd"
|
||||
"useradd"
|
||||
"common-auth"
|
||||
"common-account"
|
||||
"common-password"
|
||||
"common-session"
|
||||
]
|
||||
);
|
||||
}
|
2
system/etc/pam.d/common-account
Normal file
2
system/etc/pam.d/common-account
Normal file
@ -0,0 +1,2 @@
|
||||
account optional @pam_ldap@/lib/security/pam_ldap.so
|
||||
account required @pam_unix2@/lib/security/pam_unix2.so
|
3
system/etc/pam.d/common-auth
Normal file
3
system/etc/pam.d/common-auth
Normal file
@ -0,0 +1,3 @@
|
||||
auth sufficient @pam_ldap@/lib/security/pam_ldap.so
|
||||
auth sufficient @pam_unix2@/lib/security/pam_unix2.so
|
||||
auth required pam_deny.so
|
2
system/etc/pam.d/common-password
Normal file
2
system/etc/pam.d/common-password
Normal file
@ -0,0 +1,2 @@
|
||||
password sufficient @pam_ldap@/lib/security/pam_ldap.so
|
||||
password sufficient @pam_unix2@/lib/security/pam_unix2.so nullok
|
2
system/etc/pam.d/common-session
Normal file
2
system/etc/pam.d/common-session
Normal file
@ -0,0 +1,2 @@
|
||||
auth optional @pam_ldap@/lib/security/pam_ldap.so
|
||||
session required @pam_unix2@/lib/security/pam_unix2.so
|
@ -1,4 +1,4 @@
|
||||
auth required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
account required @pam_unix2@/lib/security/pam_unix2.so
|
||||
password required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
session required @pam_unix2@/lib/security/pam_unix2.so
|
||||
auth include common-auth
|
||||
account include common-account
|
||||
password include common-password
|
||||
session include common-session
|
||||
|
@ -1,4 +1,4 @@
|
||||
auth required @pam_unix2@/lib/security/pam_unix2.so
|
||||
account required @pam_unix2@/lib/security/pam_unix2.so
|
||||
password required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
session required @pam_unix2@/lib/security/pam_unix2.so
|
||||
auth include common-auth
|
||||
account include common-account
|
||||
password include common-password
|
||||
session include common-session
|
||||
|
@ -1,4 +1,4 @@
|
||||
auth required @pam_unix2@/lib/security/pam_unix2.so
|
||||
account required @pam_unix2@/lib/security/pam_unix2.so
|
||||
password required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
session required @pam_unix2@/lib/security/pam_unix2.so
|
||||
auth include common-auth
|
||||
account include common-account
|
||||
password include common-password
|
||||
session include common-session
|
||||
|
@ -1,5 +1,5 @@
|
||||
auth sufficient pam_rootok.so
|
||||
auth required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
account required @pam_unix2@/lib/security/pam_unix2.so
|
||||
password required @pam_unix2@/lib/security/pam_unix2.so nullok
|
||||
session required @pam_unix2@/lib/security/pam_unix2.so
|
||||
auth include common-auth
|
||||
account include common-account
|
||||
password include common-password
|
||||
session include common-session
|
||||
|
@ -17,8 +17,8 @@ fi
|
||||
# Set up the per-user profile.
|
||||
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
|
||||
mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
|
||||
if test "$(stat --printf '%U' $NIX_USER_PROFILE_DIR)" != "$USER"; then
|
||||
echo "WARNING: bad ownership on $_NIX_PROFILE_DIR" >&2
|
||||
if test "$(stat --printf '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then
|
||||
echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2
|
||||
fi
|
||||
|
||||
if ! test -L $HOME/.nix-profile; then
|
||||
|
Loading…
Reference in New Issue
Block a user