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

Leave a Reply

Please Login to comment
  Subscribe  
Notify of

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create an EXT4 file system mounted by UUID in /etc/fstab under /vol based on a logical volume of 28 logical extents.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a NFS server that exports the /opt directory in read-only mode.

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