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

Leave a Reply

Be the First to Comment!

Notify of
wpDiscuz

RHCSA7: Task of the day

Allowed time: 8 minutes.
Find all files bigger than 100MB and write their names into the /root/results.txt file.

RHCE7: Task of the day

Allowed time: 15 minutes.
Configure a httpd server with a password protected directory under the /var/www/html/private directory.

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