Exam EX200 All QuestionsBrowse all questions from this exam
Question 27

SIMULATION -

Create User Account.

Create the following user, group and group membership:

Adminuser group -

User natasha, using adminuser as a sub group

User Harry, also using adminuser as a sub group

User sarah, can not access the SHELL which is interactive in the system, and is not a member of adminuser, natasha harry sarah password is redhat.

ן¼

ן¼

    Correct Answer:

    To create the specified user accounts and group memberships, the following steps can be followed. First, create the group 'adminuser': `groupadd adminuser`. Then, add users 'natasha' and 'harry' to the 'adminuser' group: `useradd natasha -G adminuser` and `useradd harry -G adminuser`. Ensure their passwords are set to 'redhat': `echo redhat | passwd --stdin natasha` and `echo redhat | passwd --stdin harry`. Next, create the user 'sarah' without shell access and set her password: `useradd -s /sbin/nologin sarah` and `echo redhat | passwd --stdin sarah`. This properly sets up the users, groups, and group memberships as specified in the question.

Discussion
deepbrown

# groupadd Adminuser # for i in natasha Harry ; do useradd -G Adminuser $i ; echo "redhat" | passwd --stdin $i ; done # useradd -s /sbin/nologin sarah ; echo "redhat" | passwd --stdin sarah

PENNSHARK

lets assume natasha harry and sarah arent made yet which you can check using id "their usernames" lets also assume adminuser isnt created yet if it isnt you can run grep adminuser /etc/group to check if they arent groupadd adminuser useradd -G adminuser natasha useradd -G adminuser Harry useradd -s /sbin/nologin sarah passwd natasha passwd Harry passwd sarah grep adminuser /etc/group to verify if the two users are in there