Linux Questions & Answers – User Account Management

This set of 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
View Answer

Answer: a
Explanation: None.

2. The encrypted password of a user is stored in
a) /etc/shadow
b) /etc/enpasswwd
c) /etc/.passwd
d) /etc/passwd
View Answer

Answer: a
Explanation: None.

3. A user can change the default log-in shell using
a) chmod
b) chsh
c) rmsh
d) tchsh
View Answer

Answer: b
Explanation: None.
advertisement
advertisement

4. Which of the following identifiers associated with a process decide its privilege level
a) uid
b) suid
c) euid
d) gid
View Answer

Answer: c
Explanation: 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
View Answer

Answer: d
Explanation: 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: None.
advertisement

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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: None.
advertisement

10. By default, a Linux user falls under which group?
a) staff
b) others
c) same as userid (UPG)
d) system
View Answer

Answer: c
Explanation: 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: None.

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.

Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.