SYS: Create, delete, and modify local user accounts.

Share this link

Note: This is an RHCSA 7 exam objective.

To create a local user account (here user), type:

# useradd user

Note: a group with the same name is automatically created.

To create a local user account (here user) with given UID and GID, type:

# useradd -u UID -g GID user

To create a local user account (here user) with a secondary group (here team), type:

# useradd -G team user

To create a local user account (here user) without login access (useful for Samba configuration), type:

# useradd -s /sbin/nologin user

To delete a local user account (here user) with removal of the user’s home directory and the user’s mail spool (-r), type:

# userdel -r user

Note: the associated group is automatically removed.

To change the name of a user account (here from user to usr), type:

# usermod -l usr user
1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 4.71 out of 5)
Loading...

Leave a Reply

Please Login to comment
  Subscribe  
Notify of

Upcoming Events (Local Time)

  1. Feb
    1
    Fri

    1. 8:30 am - View Details
      CentOS: Dojo, Brussels, Belgium.

RHCSA7: Task of the day

Allowed time: 15 minutes.
Get an iso image of CentOS 7 (or a DVD) and set up a local repository.

RHCE7: Task of the day

Allowed time: 3 minutes.
Configure your machine to be a router.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...