Skip to main content

Using sudo su - user -c will make it as though you logged in as that person inheriting their path. That's why su user is different from su - user.

However if you are setting the path in a .bashrc file it will only take effect for interactive sessions (i.e. ssh-ing in as that user).

You should instead use .bash_profile or /etc/profile, see this.

Nate
  • 291
  • 1
  • 2