Add Comment

You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.

To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.

This is the comment you were replying to, attached to the article Giving users a home directory automatically:


Re: Giving users a home directory automatically
Posted by sphaero (83.160.xx.xx) on Thu 8 Jun 2006 at 21:28
This is very handy but if your users are also able to access through Samba no home directory will be created, since it does not authenticate through PAM. The only way around this I found was through using the 'root preexec' directive in smb.conf for the home share. Like this:
root preexec = /usr/sbin/smb-mkhomedir.sh %U
#!/bin/bash
#smb-mkhomedir.sh

DHOME="/home"
USERS_GID="1000"
SKEL="/etc/skel"

# Reads config file (will override defaults above)
[ -r /etc/adduser.conf ] && . /etc/adduser.conf


if [ -z $1 ]; then
        echo "Usage: $0 username" 1>&2
        exit 1
fi

if [ ! -e $DHOME/$1 ]; then
        mkdir -m $DIR_MODE -p $DHOME/$1
        cp -R $SKEL/* $DHOME/$1
        chown -R $1:$USERS_GID $DHOME/$1
fi

exit 0
 

Username:Anonymous
Title:
Your Comment:

Posting Format:

 

Inappropriate comments will be removed.

Some help on entry formatting is available

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search