Free 102-500 Exam Braindumps
LPIC-1 Exam 102, Part 2 of 2, version 5.0 Questions 81–85 (page: 18)

Updated On: 10-Feb-2026

Which command should be added to /etc/bash_profile to change the language of messages from an internationalised program to Portuguese (pt)? (Select TWO correct answers)

  1. export LANGUAGE="pt"
  2. export MESSAGE="pt"
  3. export LANG="pt"
  4. export LC_MESSAGES="pt"
  5. export ALL_MESSAGES="pt"

Answer(s): C,D

Explanation:

The commands that should be added to /etc/bash_profile to change the language of messages from an internationalised program to Portuguese (pt) are:
export LANG="pt"
export LC_MESSAGES="pt"
The LANG and LC_MESSAGES environment variables are used to control the language of messages from an internationalised program. The LANG variable sets the default locale for all categories, such as collation, currency, date and time formats, etc. The LC_MESSAGES variable sets the locale for the language of messages, overriding the LANG variable for this category. Therefore, to change the language of messages to Portuguese, both variables should be set to "pt" in /etc/bash_profile, which is a script that is executed when a user logs in. This will affect the current user and any subsequent login sessions.


Reference:

Locale Environment Variables in Linux ­ Baeldung on Linux Environment Variables - The Open Group
[LPI Linux Essentials - 1.4 Localization and Internationalization]



A user was not given permission to use the CRON scheduling system.
What file needs to be modified to provide that access? (Please specify the full path to the file)

  1. /etc/cron.allow

Answer(s): A

Explanation:

The /etc/cron.d/cron.allow file is a text file that contains the names of the users who are allowed to use the crontab command to create and manage their own cron jobs12. If this file exists, only the users listed in it can use the crontab command, and all other users are denied access12. If this file does not exist, the /etc/cron.d/cron.deny file is checked to see which users are not allowed to use the crontab command12. If neither file exists, only the root user can use the crontab command12. To modify the /etc/cron.d/cron.allow file, the root user can use any text editor to add or remove the names of the users who will be allowed to use the crontab command1234. For example, to allow the user frank to use the crontab command, the root user can append the name frank to the /etc/cron.d/cron.allow file1234. The root user must always be included in this file, otherwise the superuser access to the crontab command will be denied4.


Reference:

1: Linux At, Batch, Atq, Atrm Command Help and Examples - Computer Hope
2: 107.2 Lesson 1 - Linux Professional Institute Certification Programs
3: /etc/cron.allow - Linux Bash Shell Scripting Tutorial Wiki - nixCraft
4: Controlling Access to crontab (System Administration Guide ... - Oracle



Which commands can you use to change a user's account aging information? (Choose THREE correct answers.)

  1. usermod
  2. passwd
  3. chattr
  4. chage
  5. chsh

Answer(s): A,B,D

Explanation:

The commands that can be used to change a user's account aging information are:
usermod: this command can modify various user account properties, including the password expiration date, the account expiration date, the minimum and maximum password age, the password warning period, and the password inactivity period. To use this command, you need to specify the option and the value for the property you want to change, followed by the username. For example, to set the password expiration date for the user test to February 11, 2022, you can run:
usermod -e 2022-02-11 test
To view the current account aging information for a user, you can use the -l option with the usermod command. For example, to view the information for the user test, you can run:

usermod -l test passwd: this command can change the password of a user account, as well as some password aging options. To use this command, you need to specify the username and the option for the property you want to change. For example, to change the password of the user test, you can run:
passwd test
To set the maximum password age for the user test to 90 days, you can run:
passwd -x 90 test
To view the current password aging information for a user, you can use the -S option with the passwd command. For example, to view the information for the user test, you can run:
passwd -S test chage: this command can change the user password expiry and aging information, such as the password expiration date, the account expiration date, the minimum and maximum password age, the password warning period, and the password inactivity period. To use this command, you need to specify the option and the value for the property you want to change, followed by the username. For example, to set the account expiration date for the user test to February 11, 2022, you can run:
chage -E 2022-02-11 test
To view the current account aging information for a user, you can use the -l option with the chage command. For example, to view the information for the user test, you can run:
chage -l test
The other options are incorrect because:
chattr: this command can change the file attributes on a Linux file system, such as making a file immutable, append-only, or undeletable. It has nothing to do with user account aging information. chsh: this command can change the login shell of a user account, such as bash, zsh, or ksh. It has nothing to do with user account aging information.


Reference:

How to Manage User Password Expiration and Aging in Linux - Tecmint Use the Chage Command in Linux
How to set user password expirations on Linux | Enable Sysadmin How to change password and account expiry options on Linux using chage - Linux Tutorials - Learn Linux Configuration
3 ways to change user password expiration date in Linux - howtouselinux



Why is /etc/shadow not world readable if the passwords are stored in an encrypted fashion?

  1. The encrypted passwords are still subject to brute force attacks.
  2. This is just for historical reasons.
  3. There is other information in the file that needs to be kept secret.
  4. The passwords can be decrypted by anyone with root access.

Answer(s): A

Explanation:

The /etc/shadow file is not world readable because the encrypted passwords stored in it are still vulnerable to offline brute force attacks. A brute force attack is a method of trying every possible password until finding the correct one. With modern hardware and software, millions of passwords can be tried per second. If the /etc/shadow file was world readable, anyone who logged in to the system, even as a guest, could copy the file and attempt to crack the passwords without leaving any trace. By making the file readable only by the root user, the system prevents unauthorized access to the password hashes and reduces the risk of password compromise. The other options are incorrect because they do not explain the reason for the file permissions. Option B is false, as the /etc/shadow file was created to address the security issues of the /etc/passwd file, which used to store the passwords in a world readable file. Option C is partially true, as the /etc/shadow file does contain other information related to password expiration and account locking, but this is not the main reason for making the file not world readable. Option D is irrelevant, as the passwords cannot be decrypted by anyone, even with root access, as the encryption is one-way and irreversible.


Reference:

https://www.computernetworkingnotes.com/linux-tutorials/etc-shadow-file-in-linux-explained- with-examples.html https://kerneltalks.com/user-management/understanding-etc-shadow-file/



Of the ways listed, which is the best way to temporarily suspend a single user's ability to interactively login?

  1. Add the user name to /etc/nologin.
  2. Change the user's password.
  3. Change the user name in /etc/passwd.
  4. Use change to expire the user account.
  5. Place the command logout in the user's profile.

Answer(s): D

Explanation:

The best way to temporarily suspend a single user's ability to interactively login is to use the chage command to expire the user account. The chage command can modify the expiration date of a user account, which is stored in the /etc/shadow file. By setting the expiration date to a past date, the user account will be locked and the user will not be able to login. This method is temporary because the expiration date can be changed again to a future date or removed to unlock the user account. For example, to expire the user account linuxconfig, we can use the following command:
# chage -E 0 linuxconfig
This will set the expiration date to January 1, 1970, which is the epoch date. To check the expiration date of a user account, we can use the -l option:
# chage -l linuxconfig
Last password change : Aug 24, 2021
Password expires : never
Password inactive : never
Account expires : Jan 01, 1970
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

To remove the expiration date of a user account, we can use the -E option with an empty argument:
# chage -E "" linuxconfig
The other options are either invalid or not recommended. Adding the user name to /etc/nologin will not work, because /etc/nologin is a file that contains a message to be displayed to users who try to login when the system is down for maintenance. Changing the user's password is not a good idea, because it will affect the user's authentication and may cause security issues. Changing the user name in /etc/passwd will also affect the user's authentication and may cause inconsistencies with other files and services. Placing the command logout in the user's profile will not prevent the user from logging in, but only log them out immediately after login, which is not very elegant or secure.


Reference:

1: How to disable user login with Linux nologin - LinuxConfig.org
2: Disable a user's login without disabling the account - Unix & Linux Stack Exchange
3: How to Block or Disable Normal User Logins in Linux? - GeeksforGeeks
4: How to Disable User Logins on Linux | Baeldung on Linux
5: How to Disable a User in Linux - Linux Nightly
6: How to deactivate or disable a user account in Ubuntu 20.04 LTS - Vitux
7: chage(1) - Linux manual page



Viewing page 18 of 48
Viewing questions 86 - 90 out of 234 questions


Post your Comments and Discuss LPI 102-500 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!