Exam EX200 All QuestionsBrowse all questions from this exam
Question 2

SIMULATION -

Add 3 users: harry, natasha, tom.

The requirements: The Additional group of the two users: harry, Natasha is the admin group. The user: tom's login shell should be non-interactive.

    Correct Answer:

    To add three users and meet the specified requirements, follow these steps systematically. First, create an 'admin' group if it doesn't already exist, which is needed for the additional groups of Harry and Natasha. Add Harry and Natasha to the system, making sure they are also part of the 'admin' group. Add Tom to the system with a non-interactive login shell. Then verify the changes. Here are the commands you would use, along with verification steps: 1. `groupadd admin` (Creates the 'admin' group if it doesn't exist). 2. `useradd -G admin harry` (Creates the user 'harry' and adds 'harry' to the 'admin' group). 3. `useradd -G admin natasha` (Creates the user 'natasha' and adds 'natasha' to the 'admin' group). 4. `useradd -s /sbin/nologin tom` (Creates the user 'tom' and sets the shell to non-interactive). 5. `id harry; id natasha` (Displays the user information to verify additional groups). 6. `cat /etc/passwd | grep tom` (Displays the user information to verify the login shell is non-interactive). This sequence ensures that the requirements are met and verified.

Discussion
cloudsinair

RHEL 9.1 [root@server9 ~]# [root@server9 ~]#groupadd admin [root@server9 ~]# [root@server9 ~]# useradd harry -G admin [root@server9 ~]# useradd natasha -G admin [root@server9 ~]# [root@server9 ~]# useradd -s /sbin/nologin tom [root@server9 ~]#

ly01

it's all correct, I can't just understand if I have to read the question verbatim (but there is no admin group out of the box) or add them to the wheel group.

dunia

hello all , in the exam there is two connections which connection we should edit ?the active one ( the first connection ) we modify the existing OR we edit the second connection ? please anyone can answer?

thiruppathij

[root@servera ~]# groupadd admin [root@servera ~]# useradd harry [root@servera ~]# useradd natasha [root@servera ~]# useradd tom -s /sbin/nologin verify- commands [root@servera ~]# cat /etc/passwd [root@servera ~]# cat /etc/group or else #cat /etc/group | grep admin #cat /etc/passwd | grep tom

Rahul95

#useradd harry #useradd natasha #useradd tom -s /sbin/nologin #groupadd admin #usermod -G admin harry #usermod -G admin natasha #cat /etc/group | grep admin - to verify #cat /etc/passwd | grep tom

dehemox355

Is this dump still valid and up to date? I can't see questions about container or VDO and Stratis

thomasstate

apart from the shell /sbin/nologin, which other is mostly use for user

BitterOldMan

Oops, answering my own question, capital -G does the append.

BitterOldMan

The task says to add additional group admin, so shouldn't the command be: useradd -aG admin harry

wajdi005

You can do that, but the -G is also correct because the users are new. So you wont overnight any permissions.

nailimvali

*** useradd -s /sbin/nologin tom