--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


This shows you the differences between two versions of the page.

Link to this comparison view

aixautohomedir [2013/01/26 20:09] (current)
sjoerd created
Line 1: Line 1:
 += AIX Home Directory
 +Under normal circumstances you would use the PAM module to create a home directory when it not exists and a user logins. This does not work using SSH because this is considered a security breach. This article is about the autocreation of a home directory when users login using SSH. Because the pam module doesn'​t work anymore we use the "​make_home_dir"​ program from [[http://​​soft/​oss/​|TrustSec]]. ​
 +Note: The recommendations used here are mostly from the readme, this readme was however created for linux so a few commands didn't work. The commands used here are for AIX. 
 += Installation make_home_dir
 +The installation of make_home_dir on AIX is not so straight forward as hoped for. I had to perform these steps to get it working:
 +# System setup
 +# Modification make file
 +# Compile source
 +# Configure /​etc/​profile
 +== System setup
 +Before the program can be installed you need to setup your system:
 +Do the following, to setup your system:
 +Add a group named '​home':​
 +  $ mkgroup home
 +Now make the parent of the home-directories writeable to this group:
 +  $ chgrp home /home
 +  $ chmod g+w /home
 +=== AIX 6.1
 +Additionally,​ on AIX 6.1 you have to manually create the directory /​usr/​local/​sbin:​
 +mkdir /usr/local
 +mkdir /​usr/​local/​sbin
 +== Modification make file
 +The makefile is created for linux and doesn'​t work out of the box on AIX. This is the original makefile:
 +# (c) Copyright 2003 -- Frank Kirschner <​>​
 +# The install-dir of the binary
 +# The group, that make_home_dir should be started with
 +# The parent-directory of all home-directories
 +all:​ $(FILE)
 +install: $(FILE)
 + cp $(FILE) $(DEST)
 + strip $(DEST)
 + chgrp $(GROUP) $(DEST)
 + chmod g+s $(DEST)
 + groupadd $(GROUP)
 + chgrp $(GROUP) $(HOME_PARENT)
 + chmod g+w $(HOME_PARENT)
 + rm -f $(FILE)
 +$(FILE):​ $(SRC)
 + gcc -Wall -o $@ $<
 +To make this file work on AIX you'll have to edit the last line:
 +  gcc -Wall -o $@ $<
 +  gcc -Wall -o $@ $(SRC)
 +=== error
 +If you don't change the makefile you'll get this error:
 +        gcc -Wall -o make_home_dir
 +gcc: no input files
 +make: The error code from the last command is 1.
 +== Compile source
 +After this you can finally compile the source:
 +Target "​all"​ is up to date.
 +root@ms-lpar04:/​tmp/​sft/​make_home_dir-1.0>​make install
 +        cp make_home_dir /​usr/​local/​sbin/​make_home_dir
 +        strip /​usr/​local/​sbin/​make_home_dir
 +        chgrp home /​usr/​local/​sbin/​make_home_dir
 +        chmod g+s /​usr/​local/​sbin/​make_home_dir
 +COPYRIGHT ​       Makefile ​        ​README ​          ​make_home_dir ​   make_home_dir.c
 +== Configure profile
 +Now you have to add some code to the /​etc/​profile script. The original code is again for linux and doesn'​t work completely on AIX. 
 +This is the original code:
 +if [ ! -d $HOME ]
 +   ​logger Creating new home-directory $HOME
 +   /​usr/​local/​sbin/​make_home_dir
 +   cd $HOME
 +   cp -a /etc/skel/. $HOME/.
 +   echo Home directory created
 +To make it work on AIX change this line:
 +  cp -a /etc/skel/. $HOME/.
 +  cp /​etc/​skel/​.[^\.]* $HOME/
 +NOTE: for this to work you'll have to change the default shell to /bin/bash. This is already been set for LUM enabled users in eDirectory.
aixautohomedir.txt ยท Last modified: 2013/01/26 20:09 by sjoerd