Linux / Unix questions and answers focuses on Linux administration on User & Account management and related commands. It will be useful for anyone learning Linux Basics, Essentials and/or Administration.
1. User’s Primary Group id is listed in which file, at the time of creation of the user (On a standard Unix system)
a) /etc/passwd
b) /etc/groups
c) /etc/login
d) /etc/profile
Answer: a
Clarification: None.
2. The encrypted password of a user is stored in
a) /etc/shadow
b) /etc/enpasswwd
c) /etc/.passwd
d) /etc/passwd
Answer: a
Clarification: None.
3. A user can change the default log-in shell using
a) chmod
b) chsh
c) rmsh
d) tchsh
Answer: b
Clarification: None.
4. Which of the following identifiers associated with a process decide its privilege level
a) uid
b) suid
c) euid
d) gid
Answer: c
Clarification: None.
5. The /etc/passwd file doesn’t contain
a) userid
b) home directory for a user
c) login shell name
d) none of the mentioned
Answer: d
Clarification: None.
6. User id 0 is
a) An innvalid user id
b) The id of the root user
c) The id of a user when the user’s account is deleted
d) None of the mentioned
Answer: b
Clarification: None.
7. The login shell is
a) The shell program that runs when the user logs in
b) The shell program that authenticates the user while logging in
c) Common shell for all the users that belong to the same group
d) None of the mentioned
Answer: a
Clarification: None.
8. Which of the following command can be used to change the user password?
a) user can’t change the password
b) passwd
c) passd
d) pwd
Answer: b
Clarification: None.
9. What does the following command do ?
who | wc –l
a) List the number of users logged in
b) List the users
c) List the number of users in the system
d) Display the content of who command
Answer: a
Clarification: None.
10. By default, a Linux user falls under which group?
a) staff
b) others
c) same as userid (UPG)
d) system
Answer: c
Clarification: None.
11. Which of the following files need to be referred for user’s secondary group?
a) /etc/passwd
b) /etc/shadow
c) /etc/group
d) /etc/profile
Answer: c
Clarification: None.
12. The ls –l output for /etc/passwd and /usr/bin/passwd is as follows:
-rw-rw-r-- 1 root root 2807 Apr 26 13:50 /etc/passwd -r-s—x—x 1 root root 17008 May 25 02:30 /usr/bin/passwd If a user, not belonging to the group ‘root’, runs the passwd executable in an attempt to modify his password, then which of the following is true?
a) password change fails since user does not have permission to update /etc/passwd file
b) password change is successful because the program runs as root
c) passwd change program runs in kernel mode where write access to the /etc/passwd file is possible
d) /etc/passwd is a special file and the system by default allows all users to update it
Answer: b
Clarification: None.