Index:
IPXrouted(8)MAKEDEV(8)
ac(8)
accton(8)
acpiconf(8)
acpidb(8)
acpidump(8)
adding_user(8)
adduser(8)
adjkerntz(8)
amd(8)
amq(8)
ancontrol(8)
apm(8)
apmconf(8)
apmd(8)
arlcontrol(8)
arp(8)
asf(8)
atacontrol(8)
atm(8)
atmarpd(8)
atmconfig(8)
atrun(8)
authpf(8)
badsect(8)
bcmfw(8)
boot(8)
boot0cfg(8)
boot_i386(8)
bootparamd(8)
bootpd(8)
bootpef(8)
bootpgw(8)
bootptest(8)
bsdlabel(8)
bt3cfw(8)
btxld(8)
burncd(8)
camcontrol(8)
catman.local(8)
ccdconfig(8)
chat(8)
chkgrp(8)
chkprintcap(8)
chown(8)
chroot(8)
clri(8)
comcontrol(8)
comsat(8)
config(8)
conscontrol(8)
crash(8)
cron(8)
cvsbug(8)
daemon(8)
dconschat(8)
devd(8)
devfs(8)
devinfo(8)
dhclient-script(8)
dhclient(8)
digictl(8)
diskinfo(8)
disklabel(8)
diskless(8)
dmesg(8)
dnssec-keygen(8)
dnssec-signzone(8)
dump(8)
dumpfs(8)
dumpon(8)
editmap(8)
edquota(8)
extattrctl(8)
faithd(8)
fastboot(8)
fasthalt(8)
fdcontrol(8)
fdisk(8)
ffsinfo(8)
fingerd(8)
fixmount(8)
flowctl(8)
fore_dnld(8)
fsck(8)
fsck_4.2bsd(8)
fsck_ffs(8)
fsck_msdosfs(8)
fsck_ufs(8)
fsdb(8)
fsinfo(8)
fsirand(8)
ftp-proxy(8)
ftpd(8)
fwcontrol(8)
gbde(8)
gconcat(8)
geom(8)
getextattr(8)
getfmac(8)
getpmac(8)
getty(8)
ggatec(8)
ggated(8)
ggatel(8)
glabel(8)
gmirror(8)
gnop(8)
gpt(8)
graid3(8)
growfs(8)
gshsec(8)
gstat(8)
gstripe(8)
halt(8)
hccontrol(8)
hcsecd(8)
hcseriald(8)
hlfsd(8)
hprop(8)
hpropd(8)
iasl(8)
ifconfig(8)
ifmcstat(8)
ilmid(8)
inetd(8)
init(8)
intro(8)
iostat(8)
ip6addrctl(8)
ip6fw(8)
ipf(8)
ipfs(8)
ipfstat(8)
ipfw(8)
ipmon(8)
isdnd(8)
isdndebug(8)
isdndecode(8)
isdnmonitor(8)
isdnphone(8)
isdntel(8)
isdntelctl(8)
isdntrace(8)
ispcvt(8)
jail(8)
jexec(8)
jls(8)
kadmin(8)
kadmind(8)
kdc(8)
kerberos(8)
keyserv(8)
kgmon(8)
kgzip(8)
kldconfig(8)
kldload(8)
kldstat(8)
kldunload(8)
kldxref(8)
kpasswdd(8)
kstash(8)
ktrdump(8)
ktutil(8)
l2control(8)
l2ping(8)
lastlogin(8)
ldconfig(8)
loader.4th(8)
loader(8)
locate.updatedb(8)
lockd(8)
lpc(8)
lpd(8)
lptcontrol(8)
lsextattr(8)
lwresd(8)
mail.local(8)
mailstats(8)
mailwrapper(8)
makekey(8)
makemap(8)
makewhatis.local(8)
manctl(8)
map-mbone(8)
mdconfig(8)
mdmfs(8)
memcontrol(8)
mergemaster(8)
mixer(8)
mk-amd-map(8)
mknetid(8)
mknod(8)
mksnap_ffs(8)
mkuzip(8)
mld6query(8)
mlxcontrol(8)
mount(8)
mount_cd9660(8)
mount_devfs(8)
mount_ext2fs(8)
mount_fdescfs(8)
mount_linprocfs(8)
mount_mfs(8)
mount_msdosfs(8)
mount_nfs(8)
mount_nfs4(8)
mount_ntfs(8)
mount_nullfs(8)
mount_nwfs(8)
mount_portalfs(8)
mount_procfs(8)
mount_smbfs(8)
mount_std(8)
mount_udf(8)
mount_umapfs(8)
mount_unionfs(8)
mountd(8)
moused(8)
mrinfo(8)
mrouted(8)
mtest(8)
mtrace(8)
mtree(8)
named-checkconf(8)
named-checkzone(8)
named(8)
named.reconfig(8)
named.reload(8)
natd(8)
ndiscvt(8)
ndp(8)
newfs(8)
newfs_msdos(8)
newkey(8)
newsyslog(8)
nextboot(8)
nfsd(8)
nfsiod(8)
ngctl(8)
nghook(8)
nis(8)
nologin(8)
nos-tun(8)
nsupdate(8)
ntpd(8)
ntpdate(8)
ntpdc(8)
ntpq(8)
ntptime(8)
ntptrace(8)
pac(8)
pam_chroot(8)
pam_deny(8)
pam_echo(8)
pam_exec(8)
pam_ftpusers(8)
pam_group(8)
pam_guest(8)
pam_krb5(8)
pam_ksu(8)
pam_lastlog(8)
pam_login_access(8)
pam_nologin(8)
pam_opie(8)
pam_opieaccess(8)
pam_passwdqc(8)
pam_permit(8)
pam_radius(8)
pam_rhosts(8)
pam_rootok(8)
pam_securetty(8)
pam_self(8)
pam_ssh(8)
pam_tacplus(8)
pam_unix(8)
pccardc(8)
pccardd(8)
pciconf(8)
periodic(8)
pfctl(8)
pflogd(8)
picobsd(8)
ping(8)
ping6(8)
pnpinfo(8)
ppp(8)
pppctl(8)
pppd(8)
pppoed(8)
pppstats(8)
praliases(8)
procctl(8)
pstat(8)
pw(8)
pwd_mkdb(8)
pxeboot(8)
quot(8)
quotacheck(8)
quotaoff(8)
quotaon(8)
rarpd(8)
raycontrol(8)
rbootd(8)
rc(8)
rc.atm(8)
rc.d(8)
rc.early(8)
rc.firewall(8)
rc.local(8)
rc.network(8)
rc.pccard(8)
rc.sendmail(8)
rc.serial(8)
rc.shutdown(8)
rc.subr(8)
rcorder(8)
rdump(8)
reboot(8)
renice(8)
repquota(8)
rescue(8)
restore(8)
revnetgroup(8)
rexecd(8)
rfcomm_pppd(8)
rip6query(8)
rlogind(8)
rmail(8)
rmextattr(8)
rmt(8)
rmuser(8)
rndc-confgen(8)
rndc(8)
route(8)
route6d(8)
routed(8)
rpc.lockd(8)
rpc.rquotad(8)
rpc.rstatd(8)
rpc.rusersd(8)
rpc.rwalld(8)
rpc.sprayd(8)
rpc.statd(8)
rpc.umntall(8)
rpc.yppasswdd(8)
rpc.ypxfrd(8)
rpcbind(8)
rpcinfo(8)
rrenumd(8)
rrestore(8)
rshd(8)
rtadvd(8)
rtquery(8)
rtsol(8)
rtsold(8)
rwhod(8)
sa(8)
savecore(8)
sconfig(8)
scspd(8)
sdpcontrol(8)
sdpd(8)
securelevel(8)
sendmail(8)
setextattr(8)
setfmac(8)
setfsmac(8)
setkey(8)
setpmac(8)
sftp-server(8)
showmount(8)
shutdown(8)
sicontrol(8)
slattach(8)
slip(8)
sliplogin(8)
slstat(8)
smbmsg(8)
smrsh(8)
spkrtest(8)
spppcontrol(8)
spray(8)
ssh-keysign(8)
sshd(8)
sticky(8)
strfile(8)
sunlabel(8)
swapctl(8)
swapinfo(8)
swapoff(8)
swapon(8)
sync(8)
sysctl(8)
sysinstall(8)
syslogd(8)
talkd(8)
tcpd(8)
tcpdchk(8)
tcpdmatch(8)
tcpdrop(8)
telnetd(8)
tftpd(8)
timed(8)
timedc(8)
traceroute(8)
traceroute6(8)
trpt(8)
tunefs(8)
tzsetup(8)
ugidfw(8)
umount(8)
unstr(8)
updatedb(8)
usbd(8)
usbdevs(8)
verify_krb5_conf(8)
vinum(8)
vipw(8)
vmstat(8)
vnconfig(8)
watch(8)
watchdog(8)
watchdogd(8)
wicontrol(8)
wire-test(8)
wlconfig(8)
yp(8)
yp_mkdb(8)
ypbind(8)
ypinit(8)
yppoll(8)
yppush(8)
ypserv(8)
ypset(8)
ypxfr(8)
zdump(8)
zic(8)
zzz(8)
adduser(8)
NAME
adduser -- command for adding new users
SYNOPSIS
adduser [-CDENShq] [-G groups] [-L login_class] [-d partition] [-f file] [-g login_group] [-k dotdir] [-m message_file] [-s shell] [-u uid_start] [-w type]
DESCRIPTION
The adduser utility is a shell script, implemented around the pw(8) com- mand, for adding new users. It creates passwd/group entries, a home directory, copies dotfiles and sends the new user a welcome message. It supports two modes of operation. It may be used interactively at the command line to add one user at a time, or it may be directed to get the list of new users from a file and operate in batch mode without requiring any user interaction.
RESTRICTIONS
username Login name. The user name is restricted to whatever pw(8) will accept. Generally this means it may contain only lowercase char- acters or digits. Maximum length is 16 characters. The reasons for this limit are historical. Given that people have tradition- ally wanted to break this limit for aesthetic reasons, it has never been of great importance to break such a basic fundamental parameter in UNIX. You can change UT_NAMESIZE in <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/mail/aliases. full name This is typically known as the gecos field and usually contains the user's full name. Additionally, it may contain a comma sepa- rated list of values such as office number and work and home phones. If the name contains an ampersand it will be replaced by the capitalized login name when displayed by other programs. The `:' character is not allowed. shell Unless the -S argument is supplied only valid shells from the shell database (/etc/shells) are allowed. In addition, either the base name or the full path of the shell may be supplied. UID Automatically generated or your choice. It must be less than 32000. GID/login group Automatically generated or your choice. It must be less than 32000. password You may choose an empty password, disable the password, use a randomly generated password or specify your own plaintext pass- word, which will be encrypted before being stored in the user database. 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
The adduser utility reads its configuration information from /etc/adduser.conf. If this file does not exist, it will use predefined defaults. While this file may be edited by hand, the safer option is to use the -C command line argument. With this argument, adduser will start interactive input, save the answers to its prompts in /etc/adduser.conf, and promptly exit without modifying the user database. Options specified on the command line will take precedence over any values saved in this file.
OPTIONS
-C Create new configuration file and exit. This option is mutually exclusive with the -f option. -d partition Home partition. Default partition, under which all user directo- ries will be located. The /nonexistent partition is considered special. The adduser script will not create and populate a home directory by that name. Otherwise, by default it attempts to create a home directory. -D Do not attempt to create the home directory. -E Disable the account. This option will lock the account by prepending the string ``*LOCKED*'' to the password field. The account may be unlocked by the super-user with the pw(8) command: pw unlock [name | uid] -f file Get the list of accounts to create from file. If file is ``-'', then get the list from standard input. If this option is speci- fied, adduser will operate in batch mode and will not seek any user input. If an error is encountered while processing an account, it will write a message to standard error and move to the next account. The format of the input file is described below. -g login_group Normaly, if no login group is specified, it is assumed to be the same as the username. This option makes login_group the default. -G groups Additional groups. This option allows the user to specify addi- tional groups to add users to. The user is a member of these groups in addition to their login group. -m 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. Please note that the message file can reference the internal variables of the adduser script. -N Do not read the default configuration file. -q Minimal user feedback. In particular, the random password will not be echoed to standard output. -s shell Default shell for new users. The shell argument may be the base name of the shell or the full path. Unless the -S argument is supplied the shell must exist in /etc/shells or be the special shell nologin to be considered a valid shell. -S The existence or validity of the specified shell will not be checked. -u uid Use UIDs from uid on up. -w type Password type. The adduser utility allows the user to specify what type of password to create. The type argument may have one of the following values: no Disable the password. Instead of an encrypted string, the password field will contain a single `*' character. The user may not log in until the super-user manually enables the password. none Use an empty string as the password. yes Use a user-supplied string as the password. In interac- tive mode, the user will be prompted for the password. In batch mode, the last (10th) field in the line is assumed to be the password. random Generate a random string and use it as a password. The password will be echoed to standard output. In addition, it will be available for inclusion in the message file in the randompass variable.
FORMAT
When the -f option is used, the account information must be stored in a specific format. All empty lines or lines beginning with a `#' will be ignored. All other lines must contain ten colon (`:') separated fields as described below. Command line options do not take precedence over values in the fields. Only the password field may contain a `:' charac- ter as part of the string. name:uid:gid:class:change:expire:gecos:home_dir:shell:password name Login name. This field may not be empty. uid Numeric login user ID. If this field is left empty, it will be change Password ageing. This field denotes the password change date for the account. The format of this field is the same as the format of the -p argument to pw(8). It may be dd-mmm-yy[yy], where dd is for the day, mmm is for the month in numeric or alphabetical format: ``10'' or ``Oct'', and yy[yy] is the four or two digit year. To denote a time relative to the current date the format is: +n[mhdwoy], where n denotes a number, fol- lowed by the minutes, hours, days, weeks, months or years after which the password must be changed. This field may be left empty to turn it off. expire Account expiration. This field denotes the expiry date of the account. The account may not be used after the specified date. The format of this field is the same as that for password age- ing. This field may be left empty to turn it off. gecos Full name and other extra information about the user. home_dir Home directory. If this field is left empty, it will be auto- matically created by appending the username to the home parti- tion. The /nonexistent home directory is considered special and is understood to mean that no home directory is to be cre- ated for the user. shell Login shell. This field should contain either the base name or the full path to a valid login shell. password User password. This field should contain a plaintext string, which will be encrypted before being placed in the user data- base. If the password type is yes and this field is empty, it is assumed the account will have an empty password. If the password type is random and this field is not empty, its con- tents will be used as a password. This field will be ignored if the -p option is used with a no or none argument. Be care- ful not to terminate this field with a closing `:' because it will be treated as part of the password.
FILES
/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
SEE ALSO
chpass(1), passwd(1), adduser.conf(5), aliases(5), group(5), login.conf(5), passwd(5), shells(5), pw(8), pwd_mkdb(8), rmuser(8), vipw(8), yp(8)
HISTORY
The adduser command appeared in FreeBSD 2.1.
AUTHORS
This manual page and the original script, in Perl, was written by Wolfram Schneider <wosch@FreeBSD.org>. The replacement script, written as a mitigate the possibility of an attacker using this feature by refusing to evaluate the file if it is not owned and writeable only by the root user. In addition, shell special characters and operators will have to be escaped when used in the message file. Also, password ageing and account expiry times are currently setable only in batch mode or when specified in /etc/adduser.conf. The user should be able to set them in interactive mode as well. FreeBSD 5.4 March 30, 2004 FreeBSD 5.4
SPONSORED LINKS
Man(1) output converted with man2html , sed , awk