Mar.29

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 : http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-141149.html

 

Download and extract Linux PAM modules : http://www.linux-pam.org/pre/library/Linux-PAM-0.81.tar.gz

 

export PATH

 

PATH=/usr/sfw/bin:/usr/ccs/bin:/opt/sfw/bin:/opt/solarisstudio12.4/bin:$PATH
cd /var/tmp/Linux-PAM-0.81
./configure
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 pam_mkhomedir.so -B dynamic -G -lc pam_mkhomedir.o ../pammodutil/modutil_*.o
cp pam_mkhomedir.so /usr/lib/security/pam_mkhomedir.so.1
cd /usr/lib/security
ln -s pam_mkhomedir.so.1 pam_mkhomedir.so

 

finally comment /home in /etc/auto_master file

 

restart autofs:
svcadm disable autofs
avcadm enable autofs

 

include pam_mkhomedir.so in /etc/pam.conf

 

other session required pam_mkhomedir.so.1 skel=/etc/skel/ umask=0022

Share this Story:
  • facebook
  • twitter
  • gplus

About bentech4u

Comments(1)

  1. Suresh
    1932 days ago

    Hi Bent

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

    Will you be able to advice

    Please respond.

    Regards,
    B.Suresh

Leave a comment