Adding users to NIS

Brian Somers brian at Awfulhak.org
Fri Jun 1 01:33:40 BST 2007


On Wed, 30 May 2007 14:05:33 +0100
Stephen Allen <sdafreebsduk at rowyerboat.com> wrote:

> I thought I might have asked this question before, but nothing in the 
> archives...
> 
> The FreeBSD Handbook says to do this to create a new user in NIS.
> 
>        # pw useradd jsmith
>        # cd /var/yp
>        # make test-domain
> 
> Using pw didn't work, until I used 'pw -V /var/yp'.  Is this a fault 
> with my setup or an omission in the handbook?

An omission in the handbook.

You may also want to use -y.

IMHO -Y is usually a mistake as keeping the same
information in both the passwd file and the NIS
database results in passwd always getting it
wrong.

On all my NIS servers I run ypbind to get at
the (local) NIS maps and yppasswdd 'just works'.

> The handbook then says, "You could also run adduser jsmith instead of pw 
> useradd jsmith."  This doesn't work either.  Like 'pw' it just creates a 
> user in the local passwd file.
> 
> So, what is the recommended method to create a new user in NIS, bearing 
> in mind I'd want to create homedirs etc?

Well, personally I'd recommend using mkdir, cp, vi
and pwd_mkdb - that way you know what's been done.

-- 
Brian Somers                                       <brian at Awfulhak.org>
Don't _EVER_ lose your sense of humour !            <brian at FreeBSD.org>




More information about the Ukfreebsd mailing list