1

I am running Debian on a VM. I login to the GUI and go to Applications > Accessories > Terminal.

# echo shell: /bin/bash

I modified ENV_SUPATH, ENV_PATH inside of /etc/login.defs. I restarted the shell. In superuser mode echo $PATH shows my update. In normal mode echo $PATH does not show my update. I added and modified ~/.bash_profile. I still can't see my change and I'm starting to chase my tail.

/etc/login.defs contents:

ENV_SUPATH      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/brian/.linuxbrew/bin
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/brian/.linuxbrew/bin

~/.bash_profile:

PATH=/home/brian/.linuxbrew/bin:$PATH

How can I troubleshoot and resolve this?

3
  • I may be wrong but I seem to recall that ENV_PATH in /etc/login.defs is now obsolete and ignored. Commented Feb 28, 2015 at 15:51
  • 1
    Please edit your question and explain how you are logging in to this machine. Are you running a login or a non-login shell? Commented Feb 28, 2015 at 15:52
  • 1
    unix.stackexchange.com/a/122430/25985 Commented Feb 28, 2015 at 15:56

1 Answer 1

0

Short answer: also adjust /etc/profile (and /etc/sudoers carefully)

Long answer: The PATH variable is defined in multiple places.

According to login.defs(5), only su uses it.

The sudo has it's own secure PATH definition in /etc/sudoers (variable secure_path=...)

Most Unix shell will read /etc/profile and ~/.profile. In Debian, this file is used to define login shell's PATH. Bash also reads ~/.bash_profile, ~/.bash_login.

...and probably more (run grep '\<PATH\>' /etc/ -R)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.