summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMichael Pereira Neves2014-03-31 21:42:26 +0200
committerMichael Pereira Neves2014-03-31 21:42:26 +0200
commitf0c87279ad88c2a9bdd8c26aef192b56232aa777 (patch)
tree7c9bf4e05269c70d2a54fdfd7ef3db4e0a35d5f2 /server
parent[cups-curitiba] add curitiba cups config module (diff)
downloadtm-scripts-f0c87279ad88c2a9bdd8c26aef192b56232aa777.tar.gz
tm-scripts-f0c87279ad88c2a9bdd8c26aef192b56232aa777.tar.xz
tm-scripts-f0c87279ad88c2a9bdd8c26aef192b56232aa777.zip
[pam-curitiba] add curitiba pam config module
Diffstat (limited to 'server')
-rw-r--r--server/modules/pam-curitiba/etc/gssapi_mech.conf21
-rw-r--r--server/modules/pam-curitiba/etc/idmapd.conf12
-rw-r--r--server/modules/pam-curitiba/etc/krb5.conf60
-rw-r--r--server/modules/pam-curitiba/etc/krb5.keytabbin0 -> 14529 bytes
-rw-r--r--server/modules/pam-curitiba/etc/nslcd.conf6
-rw-r--r--server/modules/pam-curitiba/etc/nsswitch.conf19
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/common-account28
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/common-auth30
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/common-password37
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/common-session39
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/common-session-noninteractive33
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/kdm10
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/kdm-np11
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/login109
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/other16
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/passwd6
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/sshd41
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/vmware-authd6
-rw-r--r--server/modules/pam-curitiba/etc/pam.d/xdm6
-rw-r--r--server/modules/pam-curitiba/etc/profile.d/00-autostart.sh40
-rw-r--r--server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-gssd.service7
-rw-r--r--server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-idmapd.service7
-rw-r--r--server/modules/pam-curitiba/etc/systemd/system/rpc-gssd.service7
-rw-r--r--server/modules/pam-curitiba/etc/systemd/system/rpc-idmapd.service7
-rw-r--r--server/modules/pam-curitiba/etc/systemd/system/run-rpc_pipefs.mount7
-rw-r--r--server/modules/pam-curitiba/opt/openslx/scripts/pam_script_mount_persistent42
26 files changed, 607 insertions, 0 deletions
diff --git a/server/modules/pam-curitiba/etc/gssapi_mech.conf b/server/modules/pam-curitiba/etc/gssapi_mech.conf
new file mode 100644
index 00000000..ac41f5fd
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/gssapi_mech.conf
@@ -0,0 +1,21 @@
+# Example /etc/gssapi_mech.conf file
+#
+# GSSAPI Mechanism Definitions
+#
+# This configuration file determines which GSS-API mechanisms
+# the gssd code should use
+#
+# NOTE:
+# The initiaiization function "mechglue_internal_krb5_init"
+# is used for the MIT krb5 gssapi mechanism. This special
+# function name indicates that an internal function should
+# be used to determine the entry points for the MIT gssapi
+# mechanism funtions.
+#
+# library initialization function
+# ================================ ==========================
+# The MIT K5 gssapi library, use special function for initialization.
+libgssapi_krb5.so.2 mechglue_internal_krb5_init
+#
+# The SPKM3 gssapi library function. Use the function spkm3_gss_initialize.
+# /usr/local/gss_mechs/spkm/spkm3/libgssapi_spkm3.so spkm3_gss_initialize
diff --git a/server/modules/pam-curitiba/etc/idmapd.conf b/server/modules/pam-curitiba/etc/idmapd.conf
new file mode 100644
index 00000000..698e918e
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/idmapd.conf
@@ -0,0 +1,12 @@
+[General]
+
+Verbosity = 0
+Pipefs-Directory = /run/rpc_pipefs
+# set your own domain here, if id differs from FQDN minus hostname
+Domain = c3local
+# localdomain
+
+[Mapping]
+
+Nobody-User = nobody
+Nobody-Group = nogroup
diff --git a/server/modules/pam-curitiba/etc/krb5.conf b/server/modules/pam-curitiba/etc/krb5.conf
new file mode 100644
index 00000000..0bf51ad2
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/krb5.conf
@@ -0,0 +1,60 @@
+[libdefaults]
+ default_realm = C3LOCAL
+
+# The following krb5.conf variables are only for MIT Kerberos.
+ krb4_config = /etc/krb.conf
+ krb4_realms = /etc/krb.realms
+ kdc_timesync = 1
+ ccache_type = 4
+ forwardable = true
+ proxiable = true
+
+# The following encryption type specification will be used by MIT Kerberos
+# if uncommented. In general, the defaults in the MIT Kerberos code are
+# correct and overriding these specifications only serves to disable new
+# encryption types as they are added, creating interoperability problems.
+#
+# Thie only time when you might need to uncomment these lines and change
+# the enctypes is if you have local software that will break on ticket
+# caches containing ticket encryption types it doesn't know about (such as
+# old versions of Sun Java).
+ allow_weak_crypto = true
+ default_tgs_enctypes = des-cbc-crc des3-cbc-sha1 arcfour-hmac aes256-cts des-cbc-md5
+ default_tkt_enctypes = des-cbc-crc des3-cbc-sha1 arcfour-hmac aes256-cts des-cbc-md5
+ permitted_enctypes = des-cbc-crc des3-cbc-sha1 arcfour-hmac aes256-cts des-cbc-md5
+
+# The following libdefaults parameters are only for Heimdal Kerberos.
+ v4_instance_resolve = false
+ v4_name_convert = {
+ host = {
+ rcmd = host
+ ftp = ftp
+ }
+ plain = {
+ something = something-else
+ }
+ }
+ fcc-mit-ticketflags = true
+
+[realms]
+ C3LOCAL = {
+ kdc = urquell.c3local
+ admin_server = urquell.c3local
+ default_domain = c3local
+ passwd_server = urquell.c3local
+ }
+
+[domain_realm]
+ .c3local = C3LOCAL
+ c3local = C3LOCAL
+ .c3sl.ufpr.br = C3LOCAL
+ c3sl.ufpr.br = C3LOCAL
+
+[login]
+ krb4_convert = true
+ krb4_get_tickets = false
+
+[logging]
+ default = FILE:/var/log/krb5libs.log
+ kdc = FILE:/var/log/krb5kdc.log
+ admin_server = FILE:/var/log/kadmind.log
diff --git a/server/modules/pam-curitiba/etc/krb5.keytab b/server/modules/pam-curitiba/etc/krb5.keytab
new file mode 100644
index 00000000..a38156ec
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/krb5.keytab
Binary files differ
diff --git a/server/modules/pam-curitiba/etc/nslcd.conf b/server/modules/pam-curitiba/etc/nslcd.conf
new file mode 100644
index 00000000..aec67f5a
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/nslcd.conf
@@ -0,0 +1,6 @@
+# Cannot be a symlink to ldap.conf, as nslcd refuses to start if there are unknown options in this file...
+URI ldap://urquell
+base dc=c3local
+
+uid nslcd
+gid nslcd
diff --git a/server/modules/pam-curitiba/etc/nsswitch.conf b/server/modules/pam-curitiba/etc/nsswitch.conf
new file mode 100644
index 00000000..f431ccc9
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/nsswitch.conf
@@ -0,0 +1,19 @@
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+# If you have the `glibc-doc-reference' and `info' packages installed, try:
+# `info libc "Name Service Switch"' for information about this file.
+
+passwd: compat ldap
+group: compat ldap
+shadow: compat ldap
+
+hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
+networks: files
+
+protocols: db files
+services: db files
+ethers: db files
+rpc: db files
+
+netgroup: nis
diff --git a/server/modules/pam-curitiba/etc/pam.d/common-account b/server/modules/pam-curitiba/etc/pam.d/common-account
new file mode 100644
index 00000000..6342fa6a
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/common-account
@@ -0,0 +1,28 @@
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system. The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+#
+
+# here are the per-package modules (the "Primary" block)
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
+#account [success=1 new_authtok_reqd=done default=ignore] pam_winbind.so
+# here's the fallback if no module succeeds
+account requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+account required pam_krb5.so minimum_uid=1000
+# end of pam-auth-update config
+#session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
diff --git a/server/modules/pam-curitiba/etc/pam.d/common-auth b/server/modules/pam-curitiba/etc/pam.d/common-auth
new file mode 100644
index 00000000..70a9140a
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/common-auth
@@ -0,0 +1,30 @@
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
+# traditional Unix authentication mechanisms.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+
+# here are the per-package modules (the "Primary" block)
+auth [success=2 default=ignore] pam_krb5.so minimum_uid=1000
+auth [success=1 default=ignore] pam_unix.so nullok_secure try_first_pass
+#auth [success=1 default=ignore] pam_winbind.so krb5_auth krb5_ccache_type=FILE cached_login try_first_pass
+# here's the fallback if no module succeeds
+auth requisite pam_deny.so
+auth optional pam_script.so expose=1
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+#auth optional pam_ecryptfs.so unwrap
+#auth optional pam_cap.so
+# end of pam-auth-update config
diff --git a/server/modules/pam-curitiba/etc/pam.d/common-password b/server/modules/pam-curitiba/etc/pam.d/common-password
new file mode 100644
index 00000000..58732951
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/common-password
@@ -0,0 +1,37 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords. The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords. Without this option,
+# the default is Unix crypt. Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+
+# here are the per-package modules (the "Primary" block)
+password [success=2 default=ignore] pam_krb5.so minimum_uid=1000
+password [success=1 default=ignore] pam_unix.so obscure use_authtok try_first_pass sha512
+#password [success=1 default=ignore] pam_winbind.so use_authtok try_first_pass
+# here's the fallback if no module succeeds
+password requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+#password optional pam_gnome_keyring.so
+#password optional pam_ecryptfs.so
+# end of pam-auth-update config
diff --git a/server/modules/pam-curitiba/etc/pam.d/common-session b/server/modules/pam-curitiba/etc/pam.d/common-session
new file mode 100644
index 00000000..2dfaa5cf
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/common-session
@@ -0,0 +1,39 @@
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# The pam_umask module will set the umask according to the system default in
+# /etc/login.defs and user settings, solving the problem of different
+# umask settings with different shells, display managers, remote sessions etc.
+# See "man pam_umask".
+session optional pam_umask.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_systemd.so
+session optional pam_ck_connector.so nox11
+session optional pam_env.so readenv=1
+session optional pam_env.so readenv=1 envfile=/etc/default/locale
+session optional pam_krb5.so minimum_uid=1000
+session required pam_unix.so
+#session optional pam_winbind.so
+session sufficient pam_script.so
+session optional pam_mkhomedir.so skel=/etc/skel umask=0022
+#session optional pam_ecryptfs.so unwrap
+# end of pam-auth-update config
diff --git a/server/modules/pam-curitiba/etc/pam.d/common-session-noninteractive b/server/modules/pam-curitiba/etc/pam.d/common-session-noninteractive
new file mode 100644
index 00000000..e96d66ee
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/common-session-noninteractive
@@ -0,0 +1,33 @@
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# The pam_umask module will set the umask according to the system default in
+# /etc/login.defs and user settings, solving the problem of different
+# umask settings with different shells, display managers, remote sessions etc.
+# See "man pam_umask".
+session optional pam_umask.so
+# and here are more per-package modules (the "Additional" block)
+session optional pam_krb5.so minimum_uid=1000
+session required pam_unix.so
+#session optional pam_winbind.so
+#session optional pam_ecryptfs.so unwrap
+# end of pam-auth-update config
diff --git a/server/modules/pam-curitiba/etc/pam.d/kdm b/server/modules/pam-curitiba/etc/pam.d/kdm
new file mode 100644
index 00000000..e6a4ec9b
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/kdm
@@ -0,0 +1,10 @@
+#
+# /etc/pam.d/kdm - specify the PAM behaviour of kdm
+#
+auth required pam_nologin.so
+auth required pam_env.so readenv=1
+auth required pam_env.so readenv=1 envfile=/etc/default/locale
+auth include common-auth
+account include common-account
+password include common-password
+session include common-session
diff --git a/server/modules/pam-curitiba/etc/pam.d/kdm-np b/server/modules/pam-curitiba/etc/pam.d/kdm-np
new file mode 100644
index 00000000..dc10e5b5
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/kdm-np
@@ -0,0 +1,11 @@
+#
+# /etc/pam.d/kdm-np - specify the PAM behaviour of kdm for passwordless logins
+#
+auth required pam_nologin.so
+auth required pam_env.so readenv=1
+auth required pam_env.so readenv=1 envfile=/etc/default/locale
+session required pam_limits.so
+account include common-account
+password include common-password
+session include common-session
+auth required pam_permit.so
diff --git a/server/modules/pam-curitiba/etc/pam.d/login b/server/modules/pam-curitiba/etc/pam.d/login
new file mode 100644
index 00000000..0df79279
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/login
@@ -0,0 +1,109 @@
+#
+# The PAM configuration file for the Shadow `login' service
+#
+
+# Enforce a minimal delay in case of failure (in microseconds).
+# (Replaces the `FAIL_DELAY' setting from login.defs)
+# Note that other modules may require another minimal delay. (for example,
+# to disable any delay, you should add the nodelay option to pam_unix)
+auth optional pam_faildelay.so delay=3000000
+
+# Outputs an issue file prior to each login prompt (Replaces the
+# ISSUE_FILE option from login.defs). Uncomment for use
+# auth required pam_issue.so issue=/etc/issue
+
+# Disallows root logins except on tty's listed in /etc/securetty
+# (Replaces the `CONSOLE' setting from login.defs)
+#
+# With the default control of this module:
+# [success=ok new_authtok_reqd=ok ignore=ignore user_unknown=bad default=die]
+# root will not be prompted for a password on insecure lines.
+# if an invalid username is entered, a password is prompted (but login
+# will eventually be rejected)
+#
+# You can change it to a "requisite" module if you think root may mis-type
+# her login and should not be prompted for a password in that case. But
+# this will leave the system as vulnerable to user enumeration attacks.
+#
+# You can change it to a "required" module if you think it permits to
+# guess valid user names of your system (invalid user names are considered
+# as possibly being root on insecure lines), but root passwords may be
+# communicated over insecure lines.
+auth [success=ok new_authtok_reqd=ok ignore=ignore user_unknown=bad default=die] pam_securetty.so
+
+# Disallows other than root logins when /etc/nologin exists
+# (Replaces the `NOLOGINS_FILE' option from login.defs)
+auth requisite pam_nologin.so
+
+# SELinux needs to be the first session rule. This ensures that any
+# lingering context has been cleared. Without out this it is possible
+# that a module could execute code in the wrong domain.
+# When the module is present, "required" would be sufficient (When SELinux
+# is disabled, this returns success.)
+#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+#
+# parsing /etc/environment needs "readenv=1"
+session required pam_env.so readenv=1
+# locale variables are also kept into /etc/default/locale in etch
+# reading this file *in addition to /etc/environment* does not hurt
+session required pam_env.so readenv=1 envfile=/etc/default/locale
+
+# Standard Un*x authentication.
+auth include common-auth
+
+# This allows certain extra groups to be granted to a user
+# based on things like time of day, tty, service, and user.
+# Please edit /etc/security/group.conf to fit your needs
+# (Replaces the `CONSOLE_GROUPS' option in login.defs)
+#auth optional pam_group.so
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on logins.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account requisite pam_time.so
+
+# Uncomment and edit /etc/security/access.conf if you need to
+# set access limits.
+# (Replaces /etc/login.access file)
+# account required pam_access.so
+
+# Sets up user limits according to /etc/security/limits.conf
+# (Replaces the use of /etc/limits in old login)
+#session required pam_limits.so
+
+# Prints the last login info upon succesful login
+# (Replaces the `LASTLOG_ENAB' option from login.defs)
+session optional pam_lastlog.so
+
+# Prints the message of the day upon succesful login.
+# (Replaces the `MOTD_FILE' option in login.defs)
+# This includes a dynamically generated part from /run/motd.dynamic
+# and a static (admin-editable) part from /etc/motd.
+session optional pam_motd.so
+
+# Prints the status of the user's mailbox upon succesful login
+# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).
+#
+# This also defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+#session optional pam_mail.so standard
+
+# Standard Un*x account and session
+account include common-account
+session include common-session
+password include common-password
+
+# SELinux needs to intervene at login time to ensure that the process
+# starts in the proper default security context. Only sessions which are
+# intended to run in the user's context should be run after this.
+session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
+# When the module is present, "required" would be sufficient (When SELinux
+# is disabled, this returns success.)
diff --git a/server/modules/pam-curitiba/etc/pam.d/other b/server/modules/pam-curitiba/etc/pam.d/other
new file mode 100644
index 00000000..59d776c9
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/other
@@ -0,0 +1,16 @@
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used. If you really want nothing to happen then use pam_permit.so or
+#pam_deny.so as appropriate.
+
+# We fall back to the system default in /etc/pam.d/common-*
+#
+
+@include common-auth
+@include common-account
+@include common-password
+@include common-session
diff --git a/server/modules/pam-curitiba/etc/pam.d/passwd b/server/modules/pam-curitiba/etc/pam.d/passwd
new file mode 100644
index 00000000..32eaa3c6
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/passwd
@@ -0,0 +1,6 @@
+#
+# The PAM configuration file for the Shadow `passwd' service
+#
+
+password include common-password
+
diff --git a/server/modules/pam-curitiba/etc/pam.d/sshd b/server/modules/pam-curitiba/etc/pam.d/sshd
new file mode 100644
index 00000000..8954d639
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/sshd
@@ -0,0 +1,41 @@
+# PAM configuration for the Secure Shell service
+
+# Read environment variables from /etc/environment and
+# /etc/security/pam_env.conf.
+auth required pam_env.so # [1]
+# In Debian 4.0 (etch), locale-related environment variables were moved to
+# /etc/default/locale, so read that as well.
+auth required pam_env.so envfile=/etc/default/locale
+
+# Standard Un*x authentication.
+auth include common-auth
+
+# Disallow non-root logins when /etc/nologin exists.
+account required pam_nologin.so
+
+# Uncomment and edit /etc/security/access.conf if you need to set complex
+# access limits that are hard to express in sshd_config.
+# account required pam_access.so
+
+# Standard Un*x authorization.
+account include common-account
+
+# Standard Un*x session setup and teardown.
+session include common-session
+
+# Print the message of the day upon successful login.
+session optional pam_motd.so # [1]
+
+# TODO do we need this?
+# Print the status of the user's mailbox upon successful login.
+#session optional pam_mail.so standard noenv # [1]
+
+# TODO do we need this?
+# Set up user limits from /etc/security/limits.conf.
+#session required pam_limits.so
+
+# Set up SELinux capabilities (need modified pam)
+# session required pam_selinux.so multiple
+
+# Standard Un*x password updating.
+password include common-password
diff --git a/server/modules/pam-curitiba/etc/pam.d/vmware-authd b/server/modules/pam-curitiba/etc/pam.d/vmware-authd
new file mode 100644
index 00000000..1f9b60f9
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/vmware-authd
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth include common-auth
+account include common-account
+password include common-password
+session include common-session
+
diff --git a/server/modules/pam-curitiba/etc/pam.d/xdm b/server/modules/pam-curitiba/etc/pam.d/xdm
new file mode 100644
index 00000000..d21651db
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/pam.d/xdm
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth include common-auth
+account include common-account
+password include common-password
+session required pam_loginuid.so
+session include common-session
diff --git a/server/modules/pam-curitiba/etc/profile.d/00-autostart.sh b/server/modules/pam-curitiba/etc/profile.d/00-autostart.sh
new file mode 100644
index 00000000..c59e7abe
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/profile.d/00-autostart.sh
@@ -0,0 +1,40 @@
+#!/bin/ash
+
+TEMP_HOME_DIR="$HOME"
+PERSISTENT_HOME_DIR="$HOME/PERSISTENT"
+
+if [ -d "$PERSISTENT_HOME_DIR" ]; then
+
+ # Persistent home was mounted, take care of some conveinience
+ # Dirs
+ for file in .vim .mozilla .thunderbird .config/chromium .config/htop .config/openslx .config/xfce4 .eclipse; do
+ [ -e "$TEMP_HOME_DIR/$file" ] && break
+ if [ "x$(dirname "$file")" != "x." ]; then
+ mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")"
+ fi
+ if [ ! -d "$PERSISTENT_HOME_DIR/$file" ]; then
+ mkdir -p "$PERSISTENT_HOME_DIR/$file"
+ fi
+ ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file"
+ done
+ # Files
+ for file in .bashrc .profile .vimrc .gitconfig; do
+ [ -e "$TEMP_HOME_DIR/$file" ] && break
+ if [ "x$(dirname "$file")" != "x." ]; then
+ mkdir -p "$TEMP_HOME_DIR/$(dirname "$file")"
+ fi
+ if [ ! -e "$PERSISTENT_HOME_DIR/$file" ]; then
+ touch "$PERSISTENT_HOME_DIR/$file"
+ fi
+ ln -s "$PERSISTENT_HOME_DIR/$file" "$TEMP_HOME_DIR/$file"
+ done
+ # Check if user has autostart script and run it (so they can create more symlinks etc.)
+ if [ -x "$PERSISTENT_HOME_DIR/AUTOSTART" ]; then
+ if cd "$TEMP_HOME_DIR"; then
+ "$PERSISTENT_HOME_DIR/AUTOSTART"
+ cd - >/dev/null 2>&1
+ fi
+ fi
+
+fi
+
diff --git a/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-gssd.service b/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-gssd.service
new file mode 100644
index 00000000..79ffce8d
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-gssd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=NFS rpcsec_gss daemon
+Requires=run-rpc_pipefs.mount
+After=run-rpc_pipefs.mount
+
+[Service]
+ExecStart=/usr/sbin/rpc.gssd -f -vvv -p /run/rpc_pipefs
diff --git a/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-idmapd.service b/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-idmapd.service
new file mode 100644
index 00000000..c4da93e7
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/systemd/system/getty.target.wants/rpc-idmapd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=NFSv4 ID-name mapping daemon
+Requires=network.target run-rpc_pipefs.mount
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/rpc.idmapd -f
diff --git a/server/modules/pam-curitiba/etc/systemd/system/rpc-gssd.service b/server/modules/pam-curitiba/etc/systemd/system/rpc-gssd.service
new file mode 100644
index 00000000..79ffce8d
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/systemd/system/rpc-gssd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=NFS rpcsec_gss daemon
+Requires=run-rpc_pipefs.mount
+After=run-rpc_pipefs.mount
+
+[Service]
+ExecStart=/usr/sbin/rpc.gssd -f -vvv -p /run/rpc_pipefs
diff --git a/server/modules/pam-curitiba/etc/systemd/system/rpc-idmapd.service b/server/modules/pam-curitiba/etc/systemd/system/rpc-idmapd.service
new file mode 100644
index 00000000..c4da93e7
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/systemd/system/rpc-idmapd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=NFSv4 ID-name mapping daemon
+Requires=network.target run-rpc_pipefs.mount
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/rpc.idmapd -f
diff --git a/server/modules/pam-curitiba/etc/systemd/system/run-rpc_pipefs.mount b/server/modules/pam-curitiba/etc/systemd/system/run-rpc_pipefs.mount
new file mode 100644
index 00000000..692adce8
--- /dev/null
+++ b/server/modules/pam-curitiba/etc/systemd/system/run-rpc_pipefs.mount
@@ -0,0 +1,7 @@
+[Unit]
+Description=Pipefs RPC filesystem
+
+[Mount]
+What=rpc_pipefs
+Where=/run/rpc_pipefs
+Type=rpc_pipefs
diff --git a/server/modules/pam-curitiba/opt/openslx/scripts/pam_script_mount_persistent b/server/modules/pam-curitiba/opt/openslx/scripts/pam_script_mount_persistent
new file mode 100644
index 00000000..aa5735f2
--- /dev/null
+++ b/server/modules/pam-curitiba/opt/openslx/scripts/pam_script_mount_persistent
@@ -0,0 +1,42 @@
+###################################################################
+#
+# This script is a part of the pam_script_ses_open script
+# and is not stand-alone!
+#
+# It will try to mount the home directories of students
+# under /home/<user>/PERSISTENT using kerberos.
+#
+
+# Only run this if the user is a student
+# These have a gid > 1000
+if ! grep -q "^${PAM_USER}:" "/etc/passwd"; then
+
+ VOLUME=$(getent passwd ${PAM_USER} |cut -d ':' -f6)
+ FILESERVER="urquell"
+
+ # now we can mount the home directory!
+
+ MOUNT_OPTS="-t nfs4 -o rw,nosuid,nodev,nolock,intr,hard,sloppy,sec=krb5p"
+
+ SIGNAL=$(mktemp)
+ MOUNT_OUTPUT=$(mktemp)
+ rm -f -- "${SIGNAL}"
+ ( mount ${MOUNT_OPTS} "${FILESERVER}:${VOLUME}" "${PERSISTENT_HOME_DIR}" > "$MOUNT_OUTPUT" 2>&1 || touch "${SIGNAL}" ) &
+ MOUNT_PID=$!
+ for COUNTER in 1 2 4 4; do
+ kill -0 "${MOUNT_PID}" 2>/dev/null || break
+ sleep "${COUNTER}"
+ done
+
+ if [ -e "${SIGNAL}" ]; then
+ slxlog "pam-curitiba" "Mount of '${FILESERVER}:${VOLUME}' to '${PERSISTENT_HOME_DIR}' failed. (Args: ${MOUNT_OPTS})" "$MOUNT_OUTPUT"
+ rm -f -- "${SIGNAL}"
+ elif kill -9 "${MOUNT_PID}" 2>/dev/null; then
+ slxlog "pam-curitiba" "Mount of '${FILESERVER}:${VOLUME}' to '${PERSISTENT_HOME_DIR}' timed out. (Args: ${MOUNT_OPTS})" "$MOUNT_OUTPUT"
+ else
+ PERSISTENT_OK=yes
+ fi
+ ( sleep 2; rm -f -- "$MOUNT_OUTPUT" ) &
+
+fi
+