Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2002 09:49:53 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Bsd Neophyte <bsdneophyte@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: what is the freebsd version for "useradd -M"?
Message-ID:  <20020918084953.GA80615@happy-idiot-talk.infracaninophi>
In-Reply-To: <20020917232551.10809.qmail@web20104.mail.yahoo.com>
References:  <20020917232551.10809.qmail@web20104.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 17, 2002 at 04:25:51PM -0700, Bsd Neophyte wrote:

> useradd -c "Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$

That's the Linux useradd command: you can see the man page at
http://www.freebsd.org/cgi/man.cgi?query=useradd&apropos=0&sektion=0&manpath=Red+Hat+Linux%2Fi386+7.3&format=html

The flags mean:

    -c "Samba ODC for MYDOMAIN"      Real (GCOS) name for account

    -M                               Don't create home dir for account,
                                     even if default is to do so.

    -s /bin/false                    Use /bin/false as shell

    -n                               Add group of same name as user to
                                     be default group for account

    PERSEUS$                         Username for account.

As I remember, the trailing $ sign is significant for Samba when acting
as a domain controller.

In the BSD idiom, the equivalent would be something like:

    pw useradd -n 'PERSEUS$' -c "Samba ODC for MYDOMAIN" -d /nonexistent \
        -s /sbin/nologin

except that pw will complain that '$' is not a valid character in a
username.  Off hand the only way I can think of to get round that is
to create the account without the '$' and then use vipw(8) to add it
after the fact:

    # pw useradd -n 'PERSEUS' -c "Samba ODC for MYDOMAIN" -d /nonexistent \
        -s /sbin/nologin
    # vipw
    # vi /etc/group
    # id 'PERSEUS$'
    uid=1002(PERSEUS$) gid=1002(PERSEUS$) groups=1002(PERSEUS$)

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020918084953.GA80615>