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

User Tools

Site Tools



Recently Changed Pages:

View All Pages

View All Tags

WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.

Pages with comments

2019/11/18 13:52 1 Comment

View All Comments


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 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:

  1. System setup
  2. Modification make file
  3. Compile source
  4. 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)


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
   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.


Enter your comment. Wiki syntax is allowed:
aixautohomedir.txt · Last modified: 2019/11/18 12:21 (external edit)