Why is the correct configuration of a system's time zone important?
Correct Answer: B
Question 102
Which of the following files assigns a user to its primary group?
Correct Answer: D
The /etc/passwd file assigns a user to its primary group by specifying the group ID (GID) of the primary group in the fourth field of each line. The /etc/passwd file contains the basic information for each user account on a Linux system, such as the user name, user ID (UID), group ID (GID), home directory, login shell, etc. The format of each line is: username:password:UID:GID:comment:home:shell For example, the following line assigns the user bob to the primary group bob, which has the GID of 1001: bob:x:1001:1001::/home/bob:/bin/sh The /etc/passwd file can be viewed and modified by the root user or by using the useradd, usermod, or userdel commands123. The other files listed in the options do not assign a user to its primary group. The /etc/pgroup file does not exist by default on most Linux systems, and it is not related to the primary group. The /etc/shadow file contains the encrypted passwords and otherinformation for each user account, but not the primary group4. The /etc/group file contains the information for each group on the system, such as the group name, group password, group ID, and group members, but not the primary group of each user5. The /etc/gshadow file contains the encrypted passwords for group accounts. References: 12345
Question 103
What output is produced by the following command sequence? echo '1 2 3 4 5 6' | while read a b c; do echo result $c $b $a; done
Correct Answer: C
Explanation/Reference:
Question 104
What is the purpose of the file /etc/profile?
Correct Answer: C
The file /etc/profile is a configuration file that is read by the Bash shell when a user logs in. It contains commands and settings that apply to all users of the system, such as environment variables, PATH information, terminal settings, and security commands. Environment variables are variables that affect the behavior of programs and processes. For example, the PATH variable defines the directories where the shell looks for executable files, and the JAVA_HOME variable defines the location of the Java installation. The /etc/profile file can also source other files from the /etc/profile.d/ directory, which can contain additional scripts for setting environment variables or other system-wide settings. The /etc/profile file is not the only file that can set environment variables for a user. There are also user-specific files, such as ~/.profile, ~/.bash_profile, and ~/.bashrc, that are read by the shell after /etc/profile. These files can override or append to the settings in /etc/profile, or define new variables for the user. The order and precedence of these files depend on the type of shell (login or interactive) and the options used to start the shell. You can learn more about the difference between these files here1 and here2. Reference: https://www.thegeekdiary.com/understanding-etc-profile-configuration-file-in-linux/ https://unix.stackexchange.com/questions/704610/what-does-the-etc-profile-do
Question 105
On a system using shadowed passwords, the most correct permissions for /etc/passwd are ___ and the most correct permissions for /etc/shadow are _________.