$PATH for new users

This may be a simple linux question… when I log into osmc and echo $PATH I get

/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/osmc/bin:/opt/vc/bin

When I create a new user and echo $PATH I get:

/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

What is driving the difference? I know how to fix it, I can do it on .profile or .bashrc or other places, but I just want to know what is giving osmc the extra path that my other user does not have.

The osmc user is the default user and is set up when the OS is created and has $PATH and other variables and accesses it needs. New users are created according to the base standard of debian and the contents of /etc/skel. It you need all new users to have particular settings/folders/scripts then you can edit /etc/skel and all new users will get whatever you put in there.

Check /etc/profile.d. Unless you have a bad .profile or .bashrc, you should have these paths appended. However, depending on how you switch user, this may not always be the case.

So I simply created a new user, added it to the sudoers and I’m trying to figure out what would drive a different $PATH when I ssh in. If I ssh in as my new user, then su osmc, it still has a bath path. If I ssh in as osmc@ipaddress then my paths are good. With such a generic setup, I’m trying to figure out what is driving the difference (not just fixing it in my particular user).

My profile.d contains:

…/
./
100-add-sbin.sh*
101-apt-update.sh*
102-enable-cursor.patch*
103-generate-locale.sh*
104-add-osmc-bin.sh*
900-disable-update.sh*
901-videocore.sh*

I think it may be my /etc/profile driving it:

if [ “id -u” -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

Since the user is not root.

That’s probably it :wink: