Sunday, April 20, 2008

Adding New User

useradd

This is the command to create new user in your local system.

Create an user

useradd sikkandar

User sikkandar will be added to your local machine without home directory.

Create an user with home directory

useradd -m sikkandar

To create password for user

passwd username

For example: passwd sikkandar

For more details see man useradd

TIPS

If you forgot to create home directory and you want to create the same later, do the following:

To create the home directory for user sikkandar:

mkdir /home/sikkandar
cd /etc/skel
tar cv . | tar xvC /home/sikkandar
chown -R sikkandar.users /home/sikkandar

No comments: