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.
$ mkgroup home
Now make the parent of the home-directories writeable to this group:
$ chgrp home /home $ chmod g+w /home
mkdir /usr/local mkdir /usr/local/sbin
# (c) Copyright 2003 -- Frank Kirschner <kirschner@trustsec.de>
#
# The install-dir of the binary
BIN_DIR=/usr/local/sbin
# The group, that make_home_dir should be started with
GROUP=home
# The parent-directory of all home-directories
HOME_PARENT=/home
SRC=make_home_dir.c
FILE=make_home_dir
DEST=$(BIN_DIR)/$(FILE)
all: $(FILE)
install: $(FILE)
cp $(FILE) $(DEST)
strip $(DEST)
chgrp $(GROUP) $(DEST)
chmod g+s $(DEST)
setup:
groupadd $(GROUP)
chgrp $(GROUP) $(HOME_PARENT)
chmod g+w $(HOME_PARENT)
clean:
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 $@ $<
to:
gcc -Wall -o $@ $(SRC)
root@ms-lpar04:/tmp/sft/make_home_dir-1.0>make
gcc -Wall -o make_home_dir
gcc: no input files
make: The error code from the last command is 1.
root@ms-lpar04:/tmp/sft/make_home_dir-1.0>make
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
root@ms-lpar04:/tmp/sft/make_home_dir-1.0>ls
COPYRIGHT Makefile README make_home_dir make_home_dir.c
if [ ! -d $HOME ] then logger Creating new home-directory $HOME /usr/local/sbin/make_home_dir cd $HOME cp -a /etc/skel/. $HOME/. echo Home directory created fi
To make it work on AIX change this line:
cp -a /etc/skel/. $HOME/.
to
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.