useradd

From Initq

Jump to: navigation, search


useradd will add a new user on the system.

Contents

--skel

-k or --skel flag will copy the skeleton files into the /home directory of the new user. Skeleton files are normally kept in /etc/skel.

--home

-d or --home will tell the command where to create the home directory of the user.

--create-home

-m or --create-home will create the home directory for the user and copy the skeleton files.

--password

-p or --password flag will set the new password for the user.

--shell

-s or --shell the user will get. example /bin/bash.

erdc:~# useradd --create-home --password tester --shell /bin/bash test
erdc:~# ls -la /home/test
total 20
drwxr-xr-x 2 test test 4096 2009-11-11 14:20 .
drwxr-xr-x 5 root root 4096 2009-11-11 14:20 ..
-rw-r--r-- 1 test test  220 2008-05-12 14:02 .bash_logout
-rw-r--r-- 1 test test 3116 2008-05-12 14:02 .bashrc
-rw-r--r-- 1 test test  675 2008-05-12 14:02 .profile
Personal tools