Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
ADDUSER(8)		  BSD System Manager's Manual		    ADDUSER(8)

     adduser --	command	for adding new users

     adduser [-batch username [group,[group,...]] [class] [fullname]
	     [-class login_class]
	     [-dotdir dotdir]
	     [-group login_group]
	     [-h | -help]
	     [-home home]
	     [-message message_file]
	     [-shell shell]
	     [-s | -silent | -q	| -quiet]
	     [-uid uid_start]
	     [-v | -verbose]

     Adduser is	a simple program for adding new	users. Adduser checks the
     passwd, group and shell databases.	It creates passwd/group	entries, HOME
     directory,	dotfiles and sends the new user	a welcome message.

	     Login name. May contain only  lowercase characters	or digits.
	     Maximum length is 8 characters (see setlogin(2) BUGS section).
	     The reasons for this limit	are "Historical".  Given that people
	     have traditionally	wanted to break	this limit for aesthetic rea-
	     sons, it's	never been of great importance to break	such a basic
	     fundamental parameter in UNIX.  You can change UT_NAMESIZE	in
	     /usr/include/utmp.h and recompile the world; people have done
	     this and it works,	but you	will have problems with	any precom-
	     piled programs, or	source that assumes the	8-character name limit
	     and NIS. The NIS protocol mandates	an 8-character username.  If
	     you need a	longer login name for e-mail addresses,	you can	define
	     an	alias in /etc/aliases.
	     Firstname and surname.  The `' character is not allowed.
     shell   Only valid	shells from the	shell database or sliplogin and	pppd
     uid     Automatically generated or	your choice, must be less than 32000.
     gid/login group
	     Your choice or automatically generated.
	     If	not empty, password is encoded with crypt(3).

     Perhaps you're missing what can be	done with this scheme that falls apart
     with most other schemes.  With each user in his/her own group the user
     can safely	run with a umask of 002	and have files created in their	home
     directory and not worry about others being	able to	read them.

     For a shared area you create a separate uid/gid (like cvs or ncvs on
     freefall),	you place each person that should be able to access this area
     into that new group.

     This model	of uid/gid administration allows far greater flexibility than
     lumping users into	groups and having to muck with the umask when working
     in	a shared area.

     I have been using this model for almost 10	years and found	that it	works
     for most situations, and has never	gotten in the way.  (Rod Grimes)

     1.	  Read internal	variables.

     2.	  Read configuration file (/etc/adduser.conf).

     3.	  Parse	command	line options.

     -batch username [group[,group]...]	[class]	[fullname] [password]
	     Batch mode.

	     Check /etc/passwd,	/etc/group, /etc/shells	and exit.

     -class login_class
	     Set default login class.

	     Create new	configuration and message file and exit.

     -dotdir directory
	     Copy files	from directory into the	HOME directory of new users,
	     `' will be renamed to `.foo'.  Don't copy files if
	     directory specified is equal to no.  For security make all	files
	     writable and readable for owner, don't allow group	or world to
	     write files and allow only	owner to read/execute/write .rhost,
	     .Xauthority, .kermrc, .netrc, Mail, prv, iscreen, term.

     -group login_group
	     Login group.  USER	means that the username	is to be used as login

	     Print a summary of	options	and exit.

     -home partition
	     Default home partition where all users located.

     -message file
	     Send new users a welcome message from file.  Specifying a value
	     of	no for file causes no message to be sent to new	users.

	     Do	not read the default configuration file.

     -shell shell
	     Default shell for new users.

	     Few warnings, questions, bug reports.

     -uid uid
	     Use uid's from uid	on up.

	     Many warnings, questions. Recommended for novice users.

     `#' is a comment.
     configuration file
	     Adduser reads and writes this file.  See /etc/adduser.conf	for
	     more details.
     message file
	     Eval variables in this file. See /etc/adduser.message for more

     $ adduser

     Start adduser in interactive mode.

     $ adduser -batch baerenklau guest,staff,baer '' 'Teddy II'	qwerty7

     Create user 'baerenklau' and  login group 'baerenklau'. Invite user
     baerenklau	into groups guest, staff and baer. Use default login class.
     Realname (fullname) is 'Teddy II'.	Password is 'qwerty7' (don't use such
     passwords!). Create HOME directory	/home/baerenklau and copy all files
     and directories from /usr/share/skel to /home/baerenklau.	Send user
     baerenklau	a welcome message.

     $ adduser -uid 5000 -group	guest -message no -batch vehlefanz

     Create user 'vehlefanz'. Login group is guest. Uid	next available uid af-
     ter 5000, for instance 5007. No other groups, no realname,	no password.
     Do	not send a welcome message.

     /etc/master.passwd	   user	database
     /etc/group		   group database
     /etc/shells	   shell database
     /etc/login.conf	   login classes database
     /etc/adduser.conf	   configuration file for adduser
     /etc/adduser.message  message file	for adduser
     /usr/share/skel	   skeletal login directory
     /var/log/adduser	   logfile for adduser

     chpass(1),	finger(1), passwd(1), setlogin(2), yp(4), aliases(5),
     group(5), login.conf(5), passwd(5), shells(5), addgroup(8), pwd_mkdb(8),
     rmgroup(8), rmuser(8), vipw(8)

     The adduser command appeared in FreeBSD 2.1.

FreeBSD	2.1			January	9, 1995			   FreeBSD 2.1


Want to link to this manual page? Use this URL:

home | help