Ubuntu 24.04 - /usr/games and /usr/local/games missing in $PATH for newly created user accounts
1
vote
0
answers
141
views
A fresh installed Ubuntu 24.04 system creates the first user account. That user account has by default the following
$PATH
= /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
.
When I add a new linux user account via adduser
or useradd
, that new user only has the following $PATH
= /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
.
Directories /usr/games
and /usr/local/games
are missing. I even added the new user to the same groups as the default user, but that doesn't change anything.
I really have no idea why the default user has the additional directories /usr/games
and /usr/local/games
in his $PATH
but newly created user accounts have not.
I want that newly created user accounts also have these directories within their $PATH
. I also want to understand why the default user account has those but newly created user accounts have not.
---
**PS** I greped ~
and /etc/
for games
but I found nothing useful
---
**PPS** I found out that when I directly login (SSH/console) as the newly created user, the newly created user has the missing directories in $PATH
, it seems that those directories are only missing when using sudo -iu $NEWUSER
, but why?
Asked by paladin
(274 rep)
Feb 22, 2025, 09:25 AM
Last activity: Feb 22, 2025, 09:33 AM
Last activity: Feb 22, 2025, 09:33 AM