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 (9 votes, average: 4.67 out of 5)
Loading...

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create a XFS file system of 100MB. Mount it under /mnt. Then, increase its size by 50MB.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a caching-only DNS server to forward DNS queries.

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 ...