RHCSA 9 Exam Practice Question 3 (User & Group Management)

rhcsa 9 exam practice question 3


What Should I know About The RHCSA Exam

Question

Create three (3) users with the names, ben, mike, and martin. The three users must belong to the admin group. The user, mike’s login shell should be non-interactive. The three user’s password must be “Password123”

The question is based On The User & Group Management In The RHCSA Course on this website. If you have gone through this course, solving this wouldn’t be a problem.

RHCSA Course

User Management In Red Hat

Group Management In Red Hat

Ask Your Questions

RHCSA 9 Exam Practice Questions & Answers Collection

Answer

1. Verify if the group admin exist, if it doesn’t exist, create the group

In my lab, it doesn’t exist, so, to create the admin group, use the command,

[root@tekneed ~]# groupadd admin
[root@tekneed ~]# cat /etc/group |grep admin
printadmin:x:995:
admin:x:1001:

2. Create the users, ben & martin, and add them to the admin group

[root@tekneed ~]# useradd -G admin ben
[root@tekneed ~]# useradd -G admin martin

3. Verify that the users have been created and added to the admin group

[root@tekneed ~]# id ben
uid=1001(ben) gid=1002(ben) groups=1002(ben),1001(admin)
[root@tekneed ~]# id martin
uid=1002(martin) gid=1003(martin) groups=1003(martin),1001(admin)

4. Set password for the users

[root@tekneed ~]# passwd martin

Changing password for user martin.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@tekneed ~]# passwd ben

Changing password for user ben.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password: 
passwd: all authentication tokens updated successfully.
rhcsa 9 exam practice question 3

5. Create the user, mike and make his shell non interactive.

[root@tekneed ~]# useradd -s /sbin/nologin mike

6. Set a password for the user, mike.

[root@tekneed ~]# passwd mike

Changing password for user mike.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password: 
passwd: all authentication tokens updated successfully.

7. Add the user, mike to the admin group

[root@tekneed ~]# usermod -aG admin mike

8. Verify that the user has been added to the group and also have a non interactive shell.

[root@tekneed ~]# id mike

uid=1003(mike) gid=1004(mike) groups=1004(mike),1001(admin)
[root@tekneed ~]# cat /etc/passwd |grep mike

mike:x:1003:1004::/home/mike:/sbin/nologin

Solution Summary

groupadd admin

cat /etc/group |grep admin

useradd -G admin ben

useradd -G admin martin

passwd martin

passwd ben

useradd -s /sbin/nologin/ mike

passwd mike

usermod -aG admin mike

You can also watch the Video on RHCSA 9 Exam Practice Question 3 by clicking the link below.

Watch Video On RHCSA 9 Exam Practice Question 3 On Creating users

Ansible Automation Course

Your feedback is welcomed. If you love others, you will share with others

Be the first to comment

Leave a Reply

Your email address will not be published.


*