March 8, 2009

How to: Configure users on CentOS 5

To add user1

# useradd user1

This command will do the following:

To list the hidden files

# ls -a /home/user1

To assign a password to user1

# passwd user1

To delete user1 and the user1's home directory

# userdel -r user1

To assign user1 to the admin group

# usermod -G admin user1

To allow user1 full administrative

To add user2, user3 and user4 to the training group, and to allow them to share the /home/training directory:

  1. # mkdir /home/training
  2. # useradd user2; passwd user2
    # useradd user3; passwd user3
    # useradd user4; passwd user4
    
  3. # vi /etc/group
  4. Add the training group, give it a unique group id, and add user2, user3, and user4 to the group as follows:
    training,x,9999,user2,user3,user4
  5. # chmod 2770 /home/training
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

Filed under

Spread the word

del.icio.us Digg Furl Reddit Help

Permalink • Print
Made with WordPress and Semiologic • Sky Gold skin by Denis de Bernardy