How to create automatic home directories in Solaris 10

To achieve automatic home-directory creation in solaris is little bit difficult. If it is NFS/NIS, we can achieve this through autofs(auto_mater) method. I saw many other post saying that they have achieved this with LDAP by using scripts. I Tried the same method with scripts and it didn’t worked for me.


There is another way we can achieve this by using pluggable authentication modules(PAM).Compared to linux, solaris PAM is very limited and there is not much modules on it.


Here is the summery :


1. installed sun studio( To get gcc and other development tools)
2. compiled Linux PAM modules on solaris
3. copied the modules to security directory
4. included module in /etc/pam.conf


Download and install Solaris Studio :


Download and extract Linux PAM modules :


export PATH


cd /var/tmp/Linux-PAM-0.81
cp _pam_aconf.h libpam/include/security
cd modules/pammodutil
gcc -c -O2 -D_REENTRANT -DPAM_DYNAMIC -Wall -fPIC -I../../libpam/include -I../../libpamc/include -Iinclude modutil_cleanup.c
gcc -c -O2 -D_REENTRANT -DPAM_DYNAMIC -Wall -fPIC -I../../libpam/include -I../../libpamc/include -Iinclude modutil_ioloop.c
gcc -c -O2 -D_REENTRANT -DPAM_DYNAMIC -Wall -fPIC -I../../libpam/include -I../../libpamc/include -Iinclude modutil_getpwnam.c -D_POSIX_PTHREAD_SEMANTICS
cd ../pam_mkhomedir
gcc -c -O2 -D_REENTRANT -DPAM_DYNAMIC -Wall -fPIC -I../../libpam/include -I../../libpamc/include -I../pammodutil/include pam_mkhomedir.c
ld -o -B dynamic -G -lc pam_mkhomedir.o ../pammodutil/modutil_*.o
cp /usr/lib/security/
cd /usr/lib/security
ln -s


finally comment /home in /etc/auto_master file


restart autofs:
svcadm disable autofs
avcadm enable autofs


include in /etc/pam.conf


other session required skel=/etc/skel/ umask=0022

Share this Story:
  • facebook
  • twitter
  • gplus

About bentech4u


  1. Suresh
    1752 days ago

    Hi Bent

    I have some queries related with LDAP client on Solaris 11.3.

    Will you be able to advice

    Please respond.


Leave a comment