Skip to content

Instantly share code, notes, and snippets.

@frayos
Created May 10, 2018 19:29
Show Gist options
  • Save frayos/fba5f3753563e887581ce363c199cabb to your computer and use it in GitHub Desktop.
Save frayos/fba5f3753563e887581ce363c199cabb to your computer and use it in GitHub Desktop.
sasauth make home pam
#!/bin/sh
####
# Author Alexender Lysenko @ SAS
####
##SAS doesn't have the functionality to create home directories for end-users, but you can do that on PAM level:
########
# REQUIREMENTS :
#####
#Install oddjob-mkhomedir on the server
#Create a script /etc/pam.d/sasauth-mkhomedir.sh with the following contents:
################
dbus-send --system --dest=com.redhat.oddjob_mkhomedir --print-reply / com.redhat.oddjob_mkhomedir.mkhomedirfor string:"$PAM_USER"
#Made that script executable:
#chmod +x /etc/pam.d/sasauth-mkhomedir.sh
#Add the line below to the end of the /etc/pam.d/sasauth file (at the end of the existing account section):
#account optional pam_exec.so /etc/pam.d/sasauth-mkhomedir.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment