6

I have this line in my ~/.pam_environment:

PATH             DEFAULT=${HOME}/bin:${HOME}/.local/bin:${PATH}

and it worked perfectly well on Ubuntu 12.10, but since I've updated to 13.04 it is completely ignored:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Any ideas why?

1

1 Answer 1

0

~/.pam_environment does not use the normal syntax and you should strictly follow the pam_env.conf syntax.

Note: Using .pam_environment requires a re-login in order to initialize the variables. Restarting just the terminal is not sufficient to be able to use the variables.

Source: Session-wide environment variables.

But I think that the right place to define environment variables such as PATH is ~/.profile or ~/bashrc file (if you put them here you don't need to re-login).

6
  • Yes, I know that I have to re-login, I did that multiple times (even rebooteed) but there there was absolutely no change... It worked in Ubuntu 12.10, why would it stop doing that?
    – szx
    May 30, 2013 at 15:47
  • 1
    Can you please tell me what's wrong with my syntax as I can't see anything wrong?
    – szx
    May 30, 2013 at 15:48
  • @szx What permission have you on this file? The result of ls -l .pam_environment? May 30, 2013 at 17:08
  • 1
    In my case it works by just having the assignement (not the pam_env syntax) in the files, like VAR=value. Maybe you have an encripted home dir? Check bugs.launchpad.net/ubuntu/+source/pam/+bug/584249 and related bugs...
    – Rmano
    Oct 10, 2013 at 17:48
  • 2
    By the way, .pam_environment is better than .profile if you, like me, use a different shell like zsh.
    – Rmano
    Oct 10, 2013 at 17:49

Not the answer you're looking for? Browse other questions tagged .