LFCS · 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 configuration script executed by login shells for all users, primarily used to set global environment variables and execute startup programs.
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
(32 responses)- A3% (1)
- C91% (29)
- D6% (2)
Why each option
The `/etc/profile` file is a system-wide configuration script executed by login shells for all users, primarily used to set global environment variables and execute startup programs.
The welcome message displayed after login is typically stored in `/etc/motd` (Message Of The Day), not `/etc/profile`.
Security profiles and user login permissions are managed by system files like `/etc/passwd`, `/etc/shadow`, or PAM (Pluggable Authentication Modules) configurations, not `/etc/profile`.
/etc/profile is a global configuration file processed by login shells for all users on a Linux system. Its primary purpose is to define system-wide environment variables, default paths, and other configurations that apply to every user upon login.
Default application profiles for new users are usually handled by desktop environment settings or application-specific configurations, not a general shell profile like `/etc/profile`.
Concept tested: Purpose of `/etc/profile`
Source: https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files
Topics
Community Discussion
No community discussion yet for this question.