How to add a new user in Redhat

Posted on 24 August 2011. Filed under: Linux | Tags: , |

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

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Siapa sih ini ?

  • Kategori

  • Masa Lalu

  • Follow me…

  • Apaan nih ?

  • Yang tersesat

    • 99,128 orang
  • Paling menyesatkan

    • Almanak

      August 2011
      M T W T F S S
      « Nov   Sep »
      1234567
      891011121314
      15161718192021
      22232425262728
      293031  

    Liked it here?
    Why not try sites on the blogroll...

    %d bloggers like this: