LX0-104 · Question #7
What is the purpose of the file /etc/profile?
The correct answer is C. It contains environment variables that are set when a user logs in.. The /etc/profile file is a system-wide initialization script executed by all login shells for all users on a Linux system. Its primary purpose is to set global environment variables and execute startup scripts that apply to all users upon login.
Question
Options
- AIt contains the welcome message that is displayed after login.
- BIt contains security profiles defining which users are allowed to log in.
- CIt contains environment variables that are set when a user logs in.
- DIt contains default application profiles for users that run an application for the first time.
How the community answered
(45 responses)- A2% (1)
- B4% (2)
- C87% (39)
- D7% (3)
Why each option
The `/etc/profile` file is a system-wide initialization script executed by all login shells for all users on a Linux system. Its primary purpose is to set global environment variables and execute startup scripts that apply to all users upon login.
The welcome message is typically displayed by `/etc/motd` (Message Of The Day) or similar files, not `/etc/profile`.
Security profiles and access control are typically managed by PAM (Pluggable Authentication Modules) configurations, not `/etc/profile`.
The `/etc/profile` file is a system-wide configuration script sourced by login shells, and it is used to set environment variables and execute commands that affect all users' environments after they log in.
Application profiles are generally managed by individual application configuration files or user-specific dotfiles, not by the system-wide `/etc/profile`.
Concept tested: /etc/profile purpose
Source: https://www.man7.org/linux/man-pages/man5/profile.5.html
Topics
Community Discussion
No community discussion yet for this question.