ADDUSER(8) OpenBSD System Manager's Manual ADDUSER(8)
adduser, rmuser - add and delete users from the system
adduser [-batch username [group[,group] ...] [fullname] [password]]
[-check_only] [-class login_class] [-config_create]
[-dotdir directory] [-e method | -encryption method]
[-group login_group] [-h | -help | -?] [-home partition]
[-message file] [-noconfig] [-shell shell]
[-s | -silent | -q | -quiet] [-uid_start uid] [-uid_end uid]
[-v | -verbose] [-unencrypted]
The adduser program adds new users to the system. The rmuser program re-
moves users from the system. When not passed any arguments, both utili-
ties operate in interactive mode and prompt for any required information.
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 as-
sumed to already be properly encrypted.
Check the passwd, group, and shells databases for consistency and
problems then exit without performing any other operation.
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.
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.
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.
Specify the default home partition where all users' home directo-
ries are to be located.
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.
Specify the default shell for new users.
-silent, -s, -quiet, -q
Causes the program to print fewer warnings, questions, and bug
Use UIDs from uid up when automatically generating UIDs.
Do not use UIDs higher than uid when generating UIDs.
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 discouraged,
as the username and cleartext password will appear in the process
list, which is visible to users.
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 pwd_mkdb(8).
2. Create a home directory and copy all files from the skeletal
login directory (normally /etc/skel) to this new directory.
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
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 comple-
ments 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
It is recommended that login names contain only lowercase charac-
ters and digits. They may also contain uppercase characters,
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 ad-
dresses, you can define an alias in /etc/mail/aliases.
This should contain the user's first name and surname. The `:'
is not permitted.
The specified user login class must exist in /etc/login.conf.
shell Only valid entries from the shells(5) database or entries corre-
sponding 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 configuration
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.
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 dis-
abled to prevent spurious access to it.
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 quite
/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
Start adduser in interactive mode.
# adduser -batch falken guest,staff,beer 'Prof. Falken' joshua
Create user ``falken'' and login group ``falken''. Invite user
``falken'' into groups ``guest'', ``staff'', and ``beer''. Realname
(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 vehlefanz
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.
chpass(1), finger(1), passwd(1), setlogin(2), aliases(5), group(5),
login.conf(5), passwd(5), shells(5), nologin(8), pwd_mkdb(8), vipw(8),
OpenBSD 3.6 July 8, 1999 4