The system-wide default PATH is defined in
/etc/environment. First, verify that it's set to a sane value. For reference, here's mine, which is the same as a default install:
/etc/environment is sane and you're still having issues, you can override the default PATH in
~/.bashrc. For example, I have this in my .bashrc which appends a directory to my PATH if and only if it exists and is not already in my PATH:
if [ -d "$HOME/bin" ]; then
if [[ $PATH =~ $HOME/bin ]]; then :
else export PATH="$HOME/bin:$PATH"
Since it appears from your screenshot that you've enabled root logins, be sure to set root's .bashrc, as well. (By the way, since root can't login by default in Ubuntu, this configuration is presumably less tested and might possibly be related to your problem.)
If the first two methods fail, then check whether your XRDP client is doing something exotic. If so, you'll have to either configure it to work normally or identify a way to work around it.
I've been doing some looking around the system. You can find all the places on your system that specify a PATH with the following command (the
sudo is there because some files under
/etc are unreadable by normal users):
sudo egrep -nr '\bPATH' /etc | less
I think it's safe to ignore many of those places, resulting in the following command:
sudo egrep -nr '\bPATH' /etc | egrep -v '^/etc/(init|rc|ppp|bash_c)' | egrep -v '^Binary' | less
One file that looks possible (though I really don't know too much about it) is
/etc/login.defs. You might take a look at it.
In addition, you could grep your dotfiles as well:
egrep -nr '\bPATH' $HOME/.* | less