On a Debian server you must set a prompt and a couple of aliases for every user, and they must apply to the terminal windows users open inside their desktop session, not only to console logins. Which system-wide file is the right place for those settings?

LPIC-1 Exam 102-500, objective 105. Shells and shell scripting medium

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Not correct /etc/profile

Wrong for this case. /etc/profile is read only by login shells. A terminal window opened inside an already established session starts an interactive non-login shell, which never reads it.

Correct /etc/bash.bashrc

Correct. On Debian-family systems bash is built to read /etc/bash.bashrc for interactive shells that are not login shells, which is exactly what a terminal emulator starts.

Not correct /etc/environment

Wrong. /etc/environment is read by PAM, not by bash, and it is not a script: it accepts only plain NAME=value lines. Aliases and prompt logic cannot live there.

Not correct /etc/skel/.bashrc

Wrong. The skeleton copy is only used when a new account's home directory is created. Accounts that already exist keep the copy they were given, so changes here reach nobody who is already on the system.

Why

Bash splits its startup files along the login/non-login axis: login shells read /etc/profile and one per-user profile, interactive non-login shells read the system bashrc and ~/.bashrc. The system bashrc is a compile-time path, so it is /etc/bash.bashrc on Debian and Ubuntu and /etc/bashrc on Red Hat family systems, where it is pulled in by the default ~/.bashrc rather than by bash itself. Aliases and prompts belong on the bashrc side because they are per-shell settings that are not inherited through the environment.

Where this comes from

Cited
manual page bash(1)

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 105 and space the ones you get wrong.

Practise LPIC-1 Exam 102-500

More questions on this objective

All questions on Shells and shell scripting

Practise LPIC-1 Exam 102-500