*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> adduser (8)              



NAME    [Toc]    [Back]

     adduser, rmuser - add and delete users from the system

SYNOPSIS    [Toc]    [Back]

     adduser  [-batch  username  [group[,group]  ...]  [fullname]
             [-check_only] [-class login_class] [-config_create]
             [-dotdir directory] [-e method | -encryption method]
             [-group  login_group]  [-h  |  -help  |  -?]  [-home
             [-message file] [-noconfig] [-shell shell]
             [-s  |  -silent  |  -q  |  -quiet]  [-uid_start uid]
[-uid_end uid]
             [-v | -verbose] [-unencrypted]

     rmuser [username]

DESCRIPTION    [Toc]    [Back]

     The adduser program adds  new  users  to  the  system.   The
rmuser program removes
 users from the system.  When not passed any arguments,
both utilities
 operate in interactive mode and prompt for any required

     The options are as follows:

     -batch username [group[,group] ...] [fullname] [password]
             Enter  batch mode in which multiple users are specified on the
             command-line in a compact format.   By  default  the
password is assumed
 to already be properly encrypted.

             Check  the  passwd,  group, and shells databases for
consistency and
             problems then exit without performing any other  operation.

     -class login_class
             Use  the  specified  login_class as the default user
login class.
             See login.conf(5) for further details.

             Create or edit default configuration information and
message file
             before proceeding with the normal interactive adduser procedure.

     -dotdir directory
             Copy files from directory into the HOME directory of
new users.
             Files  named  in  the fashion of ``dot.foo'' will be
renamed to
             ``.foo''.  By default, all files are  made  writable
and readable
             by their owner.

     -encryption, -e method
             Encrypt  local  passwords using method of encryption
as described
             in login.conf(5).  If method is  ``auto'',  the  encryption type
             will be derived from the user's login class.

     -group login_group
             Specify  the  default  login group.  A value of USER
means that the
             username is to be used as the login group.

     -help, -h, -?
             Print a summary of options and exit.

     -home partition
             Specify the default home partition where all  users'
home directories
 are to be 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
             Specify the default shell for new users.

     -silent, -s, -quiet, -q
             Causes  the  program  to print fewer warnings, questions, and bug

     -uid_start uid
             Use UIDs from uid up when  automatically  generating

     -uid_end uid
             Do  not  use  UIDs  higher  than uid when generating

             Causes the program to assume that the password given
in batch
             mode is unencrypted.  The password will be encrypted
before being
             added to the password file.  Use of this  option  is
             as  the  username and cleartext password will appear
in the process
             list, which is visible to users.

     -verbose, -v
             Causes the program to print many warnings and  questions.  This
             option is recommended for novice users.

     adduser  first  performs consistency checks on the password,
group, and
     shell databases.  This includes finding any  duplicate  user
or group
     names,  illegal  shells,  or  shells that aren't executable.
Once these
     tests are passed, adduser performs the following  operations
for each new

           1.    Add  the appropriate entries to the password and
group files
                and  re-generate  the  password  database   using

           2.    Create  a home directory and copy all files from
the skeletal
                login directory (normally /etc/skel) to this  new
                Files named in the fashion of ``dot.foo'' will be
renamed to
                ``.foo'' in the new directory.

           3.   Mails the new user a welcome message at the  discretion of the
                account creator.

     Similarly, when removing a user, rmuser performs the following operations
     for the given username:

           1.   Removes any crontab(1) entries or at(1) jobs  belonging to the

           2.    Removes  the user from the password database and
all groups in
                the group database.  If a group becomes empty and
its name is
                the  same  as  the username, the group is removed
(this complements
 adduser's unique per-user groups).

           3.   Recursively deletes all files in the user's  home
directory and
                removes the directory itself (provided the directory actually
                belongs to the user).  rmuser prompts for confirmation before
                actually doing this.

           4.    Removes the user's incoming mail file if one exists.

     Understandably, rmuser  politely  refuses  to  remove  users
whose UID is 0
     (typically root).

RESTRICTIONS    [Toc]    [Back]

             It is recommended that login names contain only lowercase characters
 and digits.  They may  also  contain  uppercase
             non-leading  hyphens,  periods,  and a trailing '$'.
Login names
             may not be longer than 31 characters (see BUGS  section of
             setlogin(2)).   If  you need a longer login name for
e-mail addresses,
   you    can    define    an    alias    in

             This  should  contain the user's first name and surname.  The `:'
             is not permitted.

             The  specified  user  login  class  must  exist   in

     shell    Only  valid  entries from the shells(5) database or
entries corresponding
 to sliplogin(8) and pppd(8) are  permitted.

             This  value is the start of the range where free UID
values are
             searched for.  This value must be less than the value of uid_end.
             The  default  value  is 1000 or as configured in the

             This value is the end of the range  where  free  UID
values are
             searched for.  This value must be more than the value of
             uid_start.  The default value is  2147483647  or  as
configured in
             the configuration file.

     gid/login group
             This  value  is  generated automatically, but can be
specified at
             the discretion of the person invoking the program.

             If not empty, the password is encrypted according to
             login.conf(5).   If empty, the account will be automatically disabled
 to prevent spurious access to it.

CONFIGURATION    [Toc]    [Back]

     adduser follows these steps to extract its configuration information:

           1.   Read internal variables.
           2.   Read configuration file (/etc/adduser.conf).
           3.   Parse command-line options.

     The adduser.conf format is explained within that file and is

FILES    [Toc]    [Back]

     /etc/master.passwd     user database
     /etc/group             group database
     /etc/shells            shell database
     /etc/ptmp              lock file for the passwd database
     /etc/adduser.conf      configuration file for adduser
     /etc/adduser.message   message file for adduser
     /etc/skel              skeletal login directory
     /var/log/adduser       log file for adduser

EXAMPLES    [Toc]    [Back]

     # adduser

     Start adduser in interactive mode.

     # adduser  -batch  falken  guest,staff,beer  'Prof.  Falken'

     Create  user  ``falken'' and login group ``falken''.  Invite
     ``falken'' into groups ``guest'', ``staff'',  and  ``beer''.
     (fullname)  is  ``Prof.  Falken''.   Password  is ``joshua''
(don't use such a
     password!).  Send user falken a welcome message.

     # adduser -uid_start 5000 -group guest  -message  no  -batch

     Create  user  ``vehlefanz'' in login group ``guest''.  Start
the free UID
     search at 5000.  No other groups, no realname, no  password.
Do not send
     a welcome message.

SEE ALSO    [Toc]    [Back]

     chpass(1),  finger(1),  passwd(1),  setlogin(2), aliases(5),
     login.conf(5),     passwd(5),     shells(5),     nologin(8),
pwd_mkdb(8), vipw(8),

OpenBSD      3.6                           July      8,      1999
[ Back ]
 Similar pages
Name OS Title
rmuser FreeBSD remove users from the system
users HP-UX compact list of users who are on the system
u Tru64 Displays a compact list of users who are on the system
nologin Linux prevent non-root users from logging into the system
users Tru64 Displays a compact list of users who are on the system
mac_seeotheruids FreeBSD simple policy controlling whether users see other users
pw FreeBSD create, remove, modify & display system users and groups
groupdel HP-UX delete a group from the system
deleteModem IRIX delete a modem from the system
wall Tru64 Sends a message to all users logged into the local system or to all members of a cluster
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service