During installation, you must create a root user account for the system.
Which of the following user account number does this account use?
a. 0
b. 1
c. 10
what is
a. 0
Explanation
The root user has an account number of 0 and belongs to group 1.
References
TestOut Linux Pro 7.1 User and Group Overview
In the /etc/shadow file, which character in the password field indicates that the password is an encrypted entry?
a. *
b. !
c. $
what is
$
Explanation
In the password field of the /etc/shadow file, $ preceding the password identifies the password as an encrypted entry. The /etc/shadow file holds passwords and password expiration information for user accounts.
! or !! indicates that the account is locked and cannot be used to log in. * indicates a system user account entry (which cannot be used to log in).
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
You suspect that the gshant user account is locked.
What should you enter at the command prompt to see the status of the gshant user account?
a. passwd gshant
b. passwd -S gshant
c. passwd
what is
b. passwd -S gshant
Explanation
passwd -S gshant displays the status of the gshant user account.
LK indicates the user account is locked.
PS indicates the user account has a password.
Viewing the /etc/shadow file will also display whether the user account is disabled. The second field for each entry in the /etc/passwd file is the password field:
$ preceding the password identifies the password as an encrypted entry.
! or !! indicates that the account is locked and cannot be used to log in.
* indicates a system account entry and cannot be used to log in.
References
TestOut Linux Pro 5.0 - 7.2 User Management
You need to create a user account with the following parameters:
Login name: pmorrill
Comment: Paul Morrill
Home directory: /home/pmorrill_temp
UID: 683
Which of the following commands should you use?
a. useradd -c "Paul Morrill" -d ~/pmorrill_temp -u 683 pmorrill
b. useradd -c "Paul Morrill" -d /home/pmorrill_temp -u 683 pmorrill
what is
b. useradd -c "Paul Morrill" -d /home/pmorrill_temp -u 683 pmorrill
Explanation
Use useradd -c "Paul Morrill" -d /home/pmorrill_temp -u 683 pmorrill to create a user account with these specific parameters:
Login name: pmorrill
Comment: Paul Morrill
Home directory: /home/pmorrill_temp
UID: 683
useradd creates new user accounts. Be aware of the following useradd options:
-c adds a description for the account in the GECOS field of /etc/passwd.
-d assigns an absolute pathname to a custom home directory location.
-u assigns the user a custom UID. This is useful when assigning ownership of files and directories to a different user.
References
TestOut Linux Pro 5.0 - 7.2 User Management
During a Fedora distribution installation, you choose to add a regular user account. The only other user that has been added to the system was root.
Which of the following user IDs is MOST likely to be associated with the new user?
a. 0
b. 1
c. 1000
what is
c. 1000
xplanation
On Fedora (and in most modern distributions of Linux), accounts below 100 or 500 are used for system accounts, and user accounts begin with 1000.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
You are an IT consultant for a small company. The company wants to increase the security of their small network. You want to move their passwords from the /etc/passwd file to the /etc/shadow file.
Which of the following utilities will BEST accomplish this task?
a. cp
b. pwconv
c. sync
what is
b. pwconv
Explanation
Use the pwconv utility to move passwords from the less-secure /etc/passwd file to the more secure /etc/shadow file. You can execute the opposite of this action with the pwunconv utility. Today, however, virtually all Linux distributions ship with shadow files enabled by default.
The cp command copies files an directories. The pwck command verifies entry in the passwd and shadow files. The Shadow command manipulates the contents of the shadow password file. The sync command synchronizes cached writes to persistent storage.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
A programmer named Brandon calls with an issue. He is currently using the C shell each time he logs in, but his manager has told him to start using the Bash shell.
Which command will change brandon's shell to the desired setting?
a. useradd brandon /bin/bash/slash/bash
b. userchange brandon
c. usermod -s /bin/bash brandon
what is
c. usermod -s /bin/bash brandon
Explanation
Use the usermod utility to modify user settings. Use the -s flag to signal a change to the user's shell. The correct syntax requires the new shell value followed by the username.
References
TestOut Linux Pro 5.0 - 7.2 User Management
You have performed an audit and have found active accounts for employees who no longer work for the company. You want to disable those accounts.
Which command example will disable a user account?
a. usermod -L joer
b. usermod -l joer
c. usermod -d joey
what is
a. usermod -L joer
Explanation
Use usermod -L joer to lock the user's password, thereby disabling the account.
usermod -l joer changes the account's login name. -d is used to change the account's home directory. -u changes the account's numeric id.
References
TestOut Linux Pro 5.0 - 7.2 User Management
Given this entry in the /etc/passwd file:
pmallory:x:1001:1050:Paul Mallory:...
name:passwd: UID: GID:GECOS:Home dir:shell
Which of the following is the user ID associated with this entry.
a. x
b. 1001
c. pmallory
what is
1001
Explanation
The user ID (UID) is in the third field of the line for the user. In this question, that value is 1001.
The format for the /etc/passwd file is as follows:
name:password:UID:GID:GECOS:homedirectory:shell
(GECOS is a field that allows a text description of the user account.)
References
TestOut Linux Pro 7.1 User and Group Overview
You are viewing the /etc/passwd file, and you notice the following entry:
pclark:x:1001:1001:Petunia Clark:/home/pclark:/bin/bash
What statement BEST describes this entry?
a. The pclark user account has not set a password.
b. The pclark password is the letter x.
c. The pclark password is stored in the /etc/shadow file.
what is
c. The pclark password is stored in the /etc/shadow file.
Explanation
In this case, the x in the password field indicates that the pclark password is stored in the /etc/shadow file. The /etc/shadow file holds passwords and password expiration information for user accounts.
The /etc/passwd file holds user account information. Be aware of the following details:
Each entry identifies a user account.
Each entry contains multiple fields, with each field separated by a colon.
Be aware of the following details about the /etc/shadow file:
Using the /etc/shadow file to separate usernames from passwords increases the security of the users' passwords.
Each entry corresponds to a user account, and each entry contains multiple fields separated by colons.
An x in the password field does not indicate whether the password has been set for the user. An !, !!, or * in the password field of the /etc/shadow indicates that the corresponding user account is locked and cannot be used to log in.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
A user type has the following qualities:
Which of the following user types has these qualities?
a. Root user
b. Guest user
c. System or service user
what is
c. System or service user
Explanation
A system or service user is created by default during the Linux installation and used by the system for specific roles.
A standard user account can log into the system.
A root user can log into the system and perform administrative tasks.
A guest user account is not created on a Linux system. Other operating systems, such as Windows, create a guest account that can log in to the system.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
One of your users, Karen Scott, has recently married, and is now Karen Jones. She has requested that her username be changed from kscott to kjones.
Which of the following commands will accomplish this task without changing other values?
a. usermod -l kscott kjones
b. usermod -u kjones kscott
c. usermod -u kscott kjones
what is
a. usermod -l kjones kscott
Explanation
Use the usermod utility to modify user settings. Use the -l flag to signal a change to the username. The correct syntax requires that the new username value be given followed by the old username. The -u flag changes the uid number.
References
TestOut Linux Pro 5.0 - 7.2 User Management
A file contains the following entry:
sales:x:1001:pclark,mmckay,hsamson
Which of the following files contains similar entries?
a. /etc/passwd
b. /etc/gshadow
c. /etc/group
what is
c. /etc/group
Explanation
The following line is a sample entry in the /etc/group file:
sales:x:1001:pclark,mmckay,hsamson
The /etc/group file holds group information, including the group name, group password, group ID, and group membership information. Be aware of the following details:
Each entry in the group file identifies a group.
Each entry contains multiple fields, and fields are separated by colons.
References
TestOut Linux Pro 7.1 User and Group Overview
You need to identify which user accounts on the Linux system have encrypted passwords.
Which character in the password field of the /etc/shadow file indicates that an encrypted password is set for the user account?
a. $
b. *
c. !
what is
$
Explanation
The $ preceding the password identifies the password as an encrypted entry. The following example indicates that the user account has an encrypted password:
pclark:$ab7Y56gu9bs:12567:0:99999:7:::
Be aware of the following details about the /etc/shadow file:
Using the /etc/shadow file to separate usernames from passwords increases the security of the user passwords.
Each entry corresponds to a user account, and each entry contains multiple fields, with each field separated by a colon.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
The following line is a sample entry in the /etc/shadow file:
lclark:$ab7Y56gu9bs:12567:0:99999:7:::
What does the second field represent?
a. The users UID number.
b. The users encrypted password.
c. The users unencrypted password.
what is
b. The users encrypted password.
Explanation
The second field in this example identifies the user lclark's password. The $ at the beginning indicates the password has been encrypted.
The following apply to the password field:
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
A user with an account name larry has just been terminated from the company. There is good reason to believe that the user will attempt to access and damage files in your system in the very near future.
Which command below will disable or remove the user account from the system and remove his home directory?
a. userdel -r larry
b. userdel -home larry
c. userdel -h larrie
what is
a. userdel -r larry
Explanation
Use the userdel command to delete a user from /etc/passwd and related files that allow access. Use the -r option to simultaneously remove the home directory.
References
TestOut Linux Pro 5.0 - 7.2 User Management
In the /etc/shadow file, which character in the password field indicates that a standard user account is locked?
a. /
b. *
c. !
what is
!
Explanation
! or !! in the password field of /etc/shadow indicates the account is locked and cannot be used to log in. The /etc/shadow file holds passwords and password expiration information for user accounts.
$ preceding the password identifies the password as an encrypted entry. * indicates a system user account entry (which cannot be used to log in).
References
TestOut Linux Pro 7.1 User and Group Overview
The graphics driver was recently updated on a system. Now, the graphical user interface (GUI) is not displaying, preventing the user from logging in. You need to access the system locally to login. Which of the following commands will access the virtual terminal tty2?
a. Ctrl+Alt+F2
b. ssh localhost tty
c. echo tty2
what is
a. Ctrl+Alt+F2
Explanation
On most Linux systems, tty2 can be accessed using Ctrl+Alt+F2.
ssh localhost tty will not access tty2, but returns "Not a tty."
tty will display "/dev/pts/0".
echo tty2 will display the text "tty2" and does not provide access to the virtual terminal tty2.
References
TestOut Linux Pro 5.0 - 7.1 User and Group Overview
Which useradd option displays the default values specified in the /etc/default/useradd file?
a. a
b. b
c. D
what is
c. -D
Explanation
useradd -D displays the default values specified in the /etc/default/useradd file. The /etc/default/useradd file contains default values used by the useradd utility when creating a user account.
useradd creates new user accounts. The following options override the settings as found in /etc/default/useradd:
-c adds a description for the account in the GECOS field of /etc/passwd.
-d assigns an absolute pathname to a custom home directory location.
-e specifies the date on which the user account will be disabled.
-f specifies the number of days after a password expires until the account is permanently disabled.
-g defines the primary group membership.
-G defines the secondary group membership.
-M does not create the user's home directory.
-m creates the user's home directory (if it does not exist).
-n, N does not create a group with the same name as the user (Red Hat and Fedora).
-p defines the encrypted password.
-r specifies the user account is a system user.
-s defines the default shell.
-u assigns the user a custom UID. This is useful when assigning ownership of files and directories to a different user.
References
TestOut Linux Pro 5.0 - 7.2 User Management
You need to change the default home directory value, which is used by the useradd utility when creating a user account.
What is the full path and filename of the file you should edit?
a. /etc/default/useradd
b. /etc/default
c. etc/default/added
what is
a. /etc/default/useradd
The /etc/default/useradd file contains default values used by the useradd utility when creating a user account, including:
Group ID
Home directory
Account expiration
Default shell
Secondary group membership
References
TestOut Linux Pro 5.0 - 7.2 User Management