adding NIS users and create homedir

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Aug 18 05:28:07 PDT 2003


On Mon, Aug 18, 2003 at 01:01:39PM +0200, Antoine Jacoutot wrote:
> Hi !
> 
> I'm trying to add NIS users using the following command:
> 
> pw -V /var/yp/src/nisdomain useradd -n username -u 15001,20000 -i 15001,20000 
> -w no -c "Real Name" -d /home/username -m -s /bin/sh
> 
> It works well except that the user's home directory does not get created :(
> Where did I do wrong ?

You didn't do anything wrong.  The code is deliberately written so
that if you give the '-V' flag to pw(8), certain actions like creating
a user's home directory are not carried out.  This, I guess, is a
security measure, but I don't really understand it myself: pw(8)
doesn't run with any sort of raised permissions, so you have to run it
as a user with sufficient permissions to do the required actions by
other means.

Personally, when this was a concern for me, I wrote a wrapper script
that created the account and then built the home directory.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030818/22211f25/attachment.bin


More information about the freebsd-questions mailing list