From owner-freebsd-questions Wed Sep 18 1:50: 3 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CEE337B401 for ; Wed, 18 Sep 2002 01:50:01 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F69C43E86 for ; Wed, 18 Sep 2002 01:50:00 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk ([IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id g8I8nwc9081285; Wed, 18 Sep 2002 09:49:58 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id g8I8nrPf081284; Wed, 18 Sep 2002 09:49:53 +0100 (BST) Date: Wed, 18 Sep 2002 09:49:53 +0100 From: Matthew Seaman To: Bsd Neophyte Cc: freebsd-questions@FreeBSD.ORG Subject: Re: what is the freebsd version for "useradd -M"? Message-ID: <20020918084953.GA80615@happy-idiot-talk.infracaninophi> References: <20020917232551.10809.qmail@web20104.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020917232551.10809.qmail@web20104.mail.yahoo.com> User-Agent: Mutt/1.5.1i X-Spam-Status: No, hits=-2.4 required=5.0 tests=IN_REP_TO,SUBJ_ENDS_IN_Q_MARK,DOUBLE_CAPSWORD version=2.31 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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