Home : Linux : Red Hat 9 : Adduser

How to add a new user in Redhat 9.0

To add a user and set up the directories you want that user to have, use the useradd command. By default, this will add a user and create a home dircetory for that user, which will be located in /home.

EXAMPLE: /usr/sbin/useradd yourname will create the user yourname, and make the directory /home/yourname

Set the password for the new user by running passwd. This will give the user a password and activate the account.

EXAMPLE: /usr/bin/passwd yourname. You will be prompted twice for a password.

NOTE: If you want useradd to create more default directories than just /home/newuser, you can add them to /etc/skel. Anything you add to this directory will be created when you add a new user.

EXAMPLE: mkdir /etc/skel/www will add a directory called www to the skel dir. Now whenever you run useradd to create a new user, it will also create a www directory in the new users home directory.

There are also some options for useradd you can add if you wish, such as changing where the users home directory will be, or which skeleton directory to use. For more information on useradd options go to www.linuxdocs.org