Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jun 2003 03:22:00 +0100
From:      Jez Hancock <jez.hancock@munk.nu>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: adduser question
Message-ID:  <20030630022200.GA41348@users.munk.nu>
In-Reply-To: <1056934375.688.37.camel@farm-libranet>
References:  <1056934375.688.37.camel@farm-libranet>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 29, 2003 at 05:52:53PM -0700, Marvin J. Kosmal wrote:
> When I type adduser
> 
> I get the regular first three lines.
> 
> Check /etc/shells
> Check /etc/master.pwd
> Check /etc/group
> 
> Usernames must match regulare expression: [mkosmal]:
iirc, the first time you run adduser it prompts you to enter the default
settings you want it to use in future (here you've chosen to allow only
usernames that contain the characters mkosmal - probably not what you
wanted).  The best thing to do would be to do:

mv /etc/adduser.conf /etc/adduser.conf.bak

and then run adduser as root again.allow only usernames that contain the
characters mkosmal - probably not what you wanted).  The best thing to
do would be to do:

mv /etc/adduser.conf /etc/adduser.conf.bak

and then run adduser as root again, but this time run it as:

adduser -silent

This will stop adduser from asking you for defaults and instead will
work it out from it's default settings.


> That last line must come from an aborted prior attempt.
Yes, perhaps you thought it was prompting you for the username of the
user you wanted to add to the system (which ends up being taken as the
regular expression to describe what valid usernames should be).

> It just gets worse after that.
> 
> In /usr/sbin
> the adduser script is in part
> 
> Copyright 1995-1996 Wolfram Schneider etc. yada. yada.. yada..
If you mean you edited the file /usr/sbin/adduser, that's because the
adduser program is a perl script!  If you read through it you can work
out how adduser works :)

> 
> 
> I am using a disk that came with Teach  Yourself FreeBSD in 24 hours..
> 
> 
> 
> I tried editing the following files by had
> 
> /etc/passwd.
> /etc/master.pwd
> /etc/group
Not a good idea unless you know what you're doing.  After editing
/etc/master.passwd by hand (NOT /etc/passwd) you then need to run 
another utility, pwd_mkdb, to rebuild the system password database.

Read the man pages thoroughly before attempting that, try:

man -k passwd

to see a list of relevant manpages.


A better password management system is 'pw' - make sure you type 

pw add -D

first to setup your defaults.

To add a user do:

pw adduser youruser -m

which creates 'youruser' and a set of skeleton files in their home
directory (/home by default).

Good luck,
Jez



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