Which of the following files assigns a user to its primary group?
Answer(s): 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:shellFor 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/shThe /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 other information 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.
12345
Which of the following commands should be added to /etc/bash_profile in order to change the language of messages for an internationalized program to Portuguese (pt)?
The LC_MESSAGES environment variable specifies the language to use in diagnostic messages for an internationalized program. It can be set to any value supported by the installation, such as pt for Portuguese, en for English, fr for French, etc. The LC_MESSAGES variable can be set either globally in a shell profile file, such as /etc/bash_profile, or locally in a shell session. For example, to set the language of messages to Portuguese for the current shell session, one can use the following command:export LC_MESSAGES=ptTo verify the change, one can run an internationalized program, such as man, and see the output in Portuguese. The LC_MESSAGES variable can also be used to run a single command with a different language without affecting the system's language. For example, to run the man command with the Spanish language, one can use the following syntax:LC_MESSAGES=es manThe LC_MESSAGES variable is useful for testing how programs behave in different languages or for displaying messages in different languages1234.
Locale Environment Variables in Linux | Baeldung on Linux Linux / UNIX: TZ Environment Variable - nixCraftChanging your locale on Linux and UNIX systems - IBMSelecting message language in gcc and g++ - Stack Overflow
In which file, if present, must all users be listed that are allowed to use the cron scheduling system? (Specify the full name of the file, including path.)
Answer(s): A
The /etc/cron.allow file is a file that contains a list of users who are allowed to use the cron scheduling system. The cron scheduling system is a way of running commands or scripts at specified times or intervals. Users can create their own cron jobs by using the crontab command, which edits a file called crontab that stores the user's scheduled tasks. However, not all users may have access to the crontab command or the cron system. The access is controlled by two files: /etc/cron.allow and /etc/cron.deny. If the /etc/cron.allow file exists, then only the users listed in this file can use the crontab command and the cron system. The file should have one user name per line. If the /etc/cron.allow file does not exist, then the /etc/cron.deny file is checked. If this file exists, then the users listed in this file are denied access to the crontab command and the cron system. If neither file exists, then the access depends on the configuration of the cron daemon, which is the program that runs the cron jobs. By default, only the root user can use the cron system if no files exist. The root user can always use the cron system regardless of the existence or content of these files. To create or edit the /etc/cron.allow file, the root user needs to use a text editor such as vi, nano, or emacs. For example, to allow the users alice and bob to use the cron system, the root user can use the following command:sudo vi /etc/cron.allowAnd then add the following lines to the file:alice bobAnd then save and exit the file.
How cron.allow and cron.deny can be used to limit access to crontab for ... /etc/cron.allow - Linux Bash Shell Scripting Tutorial Wiki Linux / UNIX Restrict at / cron Usage To Authorized Users
Which commands can be used to change a user's account aging information? (Choose THREE correct answers.)
Answer(s): A,B,D
The usermod, passwd, and chage commands can be used to change a user's account aging information. These commands can modify the password expiry date, the last password change date, the minimum and maximum number of days between password changes, the number of days of warning before password expiration, and the number of days of inactivity after password expiration. The usermod command is mainly used for modifying a user account, but it also has options for changing the password expiry and aging information, such as -e, -f, -p, and -L1. The passwd command is mainly used for changing the user password, but it also has options for changing the password expiry and aging information, such as -e, -i, -n, -w, and -x2. The chage command is specifically used for changing the user password expiry and aging information, and it has options such as -d, -E, -I, -m, -M, and -W3.The other options, chattr and chsh, are not related to changing the user's account aging information. The chattr command is used to change the file attributes on a Linux file system4. The chsh command is used to change the user's login shell5.
usermod(8) -- Linux manual page passwd(1) -- Linux manual page chage(1) -- Linux manual page chattr(1) -- Linux manual page chsh(1) -- Linux manual page
Which command is used to add an empty group to the system? (Specify ONLY the command without any path or parameters.)
The groupadd command is used to add an empty group to the system. It takes the name of the group as an argument and creates an entry for it in the /etc/group file. The groupadd command also assigns a unique group ID (GID) to the new group. The groupadd command can take various options to specify the GID, the password, and other attributes of the new group. For example, groupadd -g 1000 mygroup will create a new group named mygroup with a GID of 1000.
Linux Groups - javatpoint groupadd(8) - Linux manual pageHow to Add and Delete User Groups on Linux
Post your Comments and Discuss LPI 102-500 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the 102-500 content, but please register or login to continue.