ADDUSER(8)

NAME
adduser - command for adding new users

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

DESCRIPTION
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.

RESTRICTIONS
username
    Login name. May contain only lowercase characters or digits. Maximum length is 16 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 reasons, 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 precompiled 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.
fullname
    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.
password
    If not empty, password is encoded with crypt(3).

UNIQUE GROUPS
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)

CONFIGURATION
1.  Read intern variables.
2.  Read config file (/etc/adduser.conf)
3.  Parse command line options

OPTIONS

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

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

-class login_class
    Set default login class

-create_config
    Create new config and message file and exit.

-dotdir directory
    Copy files from directory into the HOME-directory of new users, ‘dot.foo’ files 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 use username as login group.

-help,-h,-?
    Print options and exit.

-home partition
    Default home partition where all users located.

-message file
    Send new users a welcome message. Don't send message if file equal with no.

-noconfig
    Do not read config file.

-shell shell
    Default shell for new users.

-silent,-s,-quiet,-q
    Few warnings, questions, bug reports.

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

-verbose,-v
    Many warnings, questions. Recommended for novice users.

FORMATS
‘#’ is a comment.
config 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 details.

EXAMPLES

$ 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 after 5000, for instance 5007. No other groups, no realname, no password. Do not send a welcome message.

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

SEE ALSO
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)

HISTORY
The adduser command appeared in FreeBSD 2.1.