xrdp changing PATH environment variableWhere is $BASH_ENV usually set?How do you add a Windows environment variable without rebooting?Make IIS see updated environment PATH variableChanging PATH Environment Variable for all Users. (Ubuntu)PATH environmental variable has changed suddenly for root user$PATH variable for anonymous user.bash_profile not being readHow to load the environment variables at boot time before X11 on Ubuntu Precise?CentOS 7: Getting interface IP numbersPostfix Centos7Setting up proftpd/users for User Perivate Groups
Incremental Ranges!
Poisson distribution: why does time between events follow an exponential distribution?
What is the right way to float a home lab?
Could the Missouri River be running while Lake Michigan was frozen several meters deep?
What's the logic behind the the organization of Hamburg's bus transport into "rings"?
If Boris Johnson were prosecuted and convicted of lying about Brexit, can that be used to cancel Brexit?
Short story written from alien perspective with this line: "It's too bright to look at, so they don't"
How to decline physical affection from a child whose parents are pressuring them?
Is the capacitor drawn or wired wrongly?
Avoiding cliches when writing gods
I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?
In this example, which path would a monster affected by the Dissonant Whispers spell take?
Accidentally cashed a check twice
Is there any word or phrase for negative bearing?
Applicants clearly not having the skills they advertise
How to make a setting relevant?
Did thousands of women die every year due to illegal abortions before Roe v. Wade?
Do I include animal companions when calculating difficulty of an encounter?
Does Peach's float negate shorthop knockback multipliers?
Diet Coke or water?
How do you build a story from a world?
Linux tr to convert vertical text to horizontal
Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up
Do adult Russians normally hand-write Cyrillic as cursive or as block letters?
xrdp changing PATH environment variable
Where is $BASH_ENV usually set?How do you add a Windows environment variable without rebooting?Make IIS see updated environment PATH variableChanging PATH Environment Variable for all Users. (Ubuntu)PATH environmental variable has changed suddenly for root user$PATH variable for anonymous user.bash_profile not being readHow to load the environment variables at boot time before X11 on Ubuntu Precise?CentOS 7: Getting interface IP numbersPostfix Centos7Setting up proftpd/users for User Perivate Groups
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
All,
I'm using xrdp to connect to a Centos 7 box. I notice that my PATH environment variable is different depending on whether I RDP in or SSH and I can't for the life of me figure out where that's happening.
I've checked /etc/xrdp/startwm.sh but all the PATH related code is already commented out. My /etc/profile is fairly standard and there's nothing in /etc/profile.d that would be doing this. Besides, if it were somewhere in /etc/profile[.d] then that would be applied even during SSH logins.
I've seen this mentioned a few times in various places on the Internets with no real solution or explanation.
Anyone have an explanation and can point me in the right direction?
Kind of driving me crazy not knowing where this is happening!
EDIT:
I should have been more clear. It's the RDP scenario that I am having trouble figuring out. I can pretty much explain all the PATH related shenanigans I see during an SSH session (or even during a VNC session, mostly anyway). If I look through the /etc/profile* settings as well as my own ~/.bash_profile, things make sense during an SSH session. But when I RDP in, things get weird.
In addition to /etc/xrdp/startwm.sh, I checked /etc/security/pam_env.conf in which everything was already commented out.
EDIT 2:
In an SSH/normal login session, my path looks like:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
In an RDP session, my PATH looks like:
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
I can see in /etc/profile where /usr/local/sbin and /usr/sbin are being appended (or prepended if root).
In the RDP case, there are a couple additions as well as things being rearranged. For example, /bin is all of a sudden present, as well as /usr/XllR6/bin. Also, /usr/bin is now before /usr/local/bin. It's mostly this last part that I don't want.
I know I could fix it up in my own ~/.bash_profile, but I don't see why I should have to. Don't see why the path is being messed with to that degree in the first place.
Thanks,
Justin
centos remote-desktop centos7 environment-variables
add a comment |
All,
I'm using xrdp to connect to a Centos 7 box. I notice that my PATH environment variable is different depending on whether I RDP in or SSH and I can't for the life of me figure out where that's happening.
I've checked /etc/xrdp/startwm.sh but all the PATH related code is already commented out. My /etc/profile is fairly standard and there's nothing in /etc/profile.d that would be doing this. Besides, if it were somewhere in /etc/profile[.d] then that would be applied even during SSH logins.
I've seen this mentioned a few times in various places on the Internets with no real solution or explanation.
Anyone have an explanation and can point me in the right direction?
Kind of driving me crazy not knowing where this is happening!
EDIT:
I should have been more clear. It's the RDP scenario that I am having trouble figuring out. I can pretty much explain all the PATH related shenanigans I see during an SSH session (or even during a VNC session, mostly anyway). If I look through the /etc/profile* settings as well as my own ~/.bash_profile, things make sense during an SSH session. But when I RDP in, things get weird.
In addition to /etc/xrdp/startwm.sh, I checked /etc/security/pam_env.conf in which everything was already commented out.
EDIT 2:
In an SSH/normal login session, my path looks like:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
In an RDP session, my PATH looks like:
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
I can see in /etc/profile where /usr/local/sbin and /usr/sbin are being appended (or prepended if root).
In the RDP case, there are a couple additions as well as things being rearranged. For example, /bin is all of a sudden present, as well as /usr/XllR6/bin. Also, /usr/bin is now before /usr/local/bin. It's mostly this last part that I don't want.
I know I could fix it up in my own ~/.bash_profile, but I don't see why I should have to. Don't see why the path is being messed with to that degree in the first place.
Thanks,
Justin
centos remote-desktop centos7 environment-variables
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15
add a comment |
All,
I'm using xrdp to connect to a Centos 7 box. I notice that my PATH environment variable is different depending on whether I RDP in or SSH and I can't for the life of me figure out where that's happening.
I've checked /etc/xrdp/startwm.sh but all the PATH related code is already commented out. My /etc/profile is fairly standard and there's nothing in /etc/profile.d that would be doing this. Besides, if it were somewhere in /etc/profile[.d] then that would be applied even during SSH logins.
I've seen this mentioned a few times in various places on the Internets with no real solution or explanation.
Anyone have an explanation and can point me in the right direction?
Kind of driving me crazy not knowing where this is happening!
EDIT:
I should have been more clear. It's the RDP scenario that I am having trouble figuring out. I can pretty much explain all the PATH related shenanigans I see during an SSH session (or even during a VNC session, mostly anyway). If I look through the /etc/profile* settings as well as my own ~/.bash_profile, things make sense during an SSH session. But when I RDP in, things get weird.
In addition to /etc/xrdp/startwm.sh, I checked /etc/security/pam_env.conf in which everything was already commented out.
EDIT 2:
In an SSH/normal login session, my path looks like:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
In an RDP session, my PATH looks like:
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
I can see in /etc/profile where /usr/local/sbin and /usr/sbin are being appended (or prepended if root).
In the RDP case, there are a couple additions as well as things being rearranged. For example, /bin is all of a sudden present, as well as /usr/XllR6/bin. Also, /usr/bin is now before /usr/local/bin. It's mostly this last part that I don't want.
I know I could fix it up in my own ~/.bash_profile, but I don't see why I should have to. Don't see why the path is being messed with to that degree in the first place.
Thanks,
Justin
centos remote-desktop centos7 environment-variables
All,
I'm using xrdp to connect to a Centos 7 box. I notice that my PATH environment variable is different depending on whether I RDP in or SSH and I can't for the life of me figure out where that's happening.
I've checked /etc/xrdp/startwm.sh but all the PATH related code is already commented out. My /etc/profile is fairly standard and there's nothing in /etc/profile.d that would be doing this. Besides, if it were somewhere in /etc/profile[.d] then that would be applied even during SSH logins.
I've seen this mentioned a few times in various places on the Internets with no real solution or explanation.
Anyone have an explanation and can point me in the right direction?
Kind of driving me crazy not knowing where this is happening!
EDIT:
I should have been more clear. It's the RDP scenario that I am having trouble figuring out. I can pretty much explain all the PATH related shenanigans I see during an SSH session (or even during a VNC session, mostly anyway). If I look through the /etc/profile* settings as well as my own ~/.bash_profile, things make sense during an SSH session. But when I RDP in, things get weird.
In addition to /etc/xrdp/startwm.sh, I checked /etc/security/pam_env.conf in which everything was already commented out.
EDIT 2:
In an SSH/normal login session, my path looks like:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
In an RDP session, my PATH looks like:
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin
I can see in /etc/profile where /usr/local/sbin and /usr/sbin are being appended (or prepended if root).
In the RDP case, there are a couple additions as well as things being rearranged. For example, /bin is all of a sudden present, as well as /usr/XllR6/bin. Also, /usr/bin is now before /usr/local/bin. It's mostly this last part that I don't want.
I know I could fix it up in my own ~/.bash_profile, but I don't see why I should have to. Don't see why the path is being messed with to that degree in the first place.
Thanks,
Justin
centos remote-desktop centos7 environment-variables
centos remote-desktop centos7 environment-variables
edited Jul 31 '15 at 12:14
Justin Miller
asked Jul 30 '15 at 19:13
Justin MillerJustin Miller
1085
1085
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15
add a comment |
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15
add a comment |
2 Answers
2
active
oldest
votes
I had this problem under 6.6. Don't know if the same under 7.
/etc/profile
sets system-wide environment variables and adds "sbin" paths for the "root" user. /etc/xrdp/startwm.sh
loads this file in the pre_start()
function which is executed at the bottom of the file.
But the top of /etc/xrdp/startwm.sh
looks like this:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
if [ -f /etc/X11/xinit/xinitrc ]
then
. /etc/X11/xinit/xinitrc
exit 0
fi
So, if /etc/X11/xinit/xinitrc
exists, /etc/xrdp/startwm.sh
executes it and terminates so none of the remaining setup is done. /etc/X11/xinit/xinitrc does not load /etc/profile, at least mine didn't.
I commented out the check for xinitrc
in startwm.sh
:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
#if [ -f /etc/X11/xinit/xinitrc ]
#then
# . /etc/X11/xinit/xinitrc
# exit 0
#fi
This solved the problem for me and I didn't notice any difference in the function of XRDP.
add a comment |
I'm not sure if this will solve your issue, since it impacts Ubuntu with XRDP and XFCE4. Still, there is a chance it does, so let's see.
I was facing a similar problem: the PATH environment variable was different when I logged into the machine through SSH and through XRDP. Concretely, when I opened a Terminal window in XRDP (xterm
), the PATH variable was not set with local user paths (~/bin
, ~/.local/bin
, etc).
However, these paths were present when I logged in through SSH.
The problem was not in XRDP, but in how the Bash session is created with XTerm and with SSH. Since SSH creates a login session, the loaded files included /etc/environment
and ~/.profile
. In the latter, the paths I required were included.
This was not the case with XTerm. It creates a non-login bash session, and thus it loads /etc/bash.bashrc
and ~/.bashrc
.
The way I could fix it was simply to include the PATH initialization line from ~/.profile
into one of these two files. Since I wanted this to impact all the users in the machine, I included it into /etc/bash.bashrc
:
echo PATH="$HOME/bin:$HOME/.local/bin:$PATH" >> /etc/bash.bashrc
You can find more information about how works in man bash
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f709777%2fxrdp-changing-path-environment-variable%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had this problem under 6.6. Don't know if the same under 7.
/etc/profile
sets system-wide environment variables and adds "sbin" paths for the "root" user. /etc/xrdp/startwm.sh
loads this file in the pre_start()
function which is executed at the bottom of the file.
But the top of /etc/xrdp/startwm.sh
looks like this:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
if [ -f /etc/X11/xinit/xinitrc ]
then
. /etc/X11/xinit/xinitrc
exit 0
fi
So, if /etc/X11/xinit/xinitrc
exists, /etc/xrdp/startwm.sh
executes it and terminates so none of the remaining setup is done. /etc/X11/xinit/xinitrc does not load /etc/profile, at least mine didn't.
I commented out the check for xinitrc
in startwm.sh
:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
#if [ -f /etc/X11/xinit/xinitrc ]
#then
# . /etc/X11/xinit/xinitrc
# exit 0
#fi
This solved the problem for me and I didn't notice any difference in the function of XRDP.
add a comment |
I had this problem under 6.6. Don't know if the same under 7.
/etc/profile
sets system-wide environment variables and adds "sbin" paths for the "root" user. /etc/xrdp/startwm.sh
loads this file in the pre_start()
function which is executed at the bottom of the file.
But the top of /etc/xrdp/startwm.sh
looks like this:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
if [ -f /etc/X11/xinit/xinitrc ]
then
. /etc/X11/xinit/xinitrc
exit 0
fi
So, if /etc/X11/xinit/xinitrc
exists, /etc/xrdp/startwm.sh
executes it and terminates so none of the remaining setup is done. /etc/X11/xinit/xinitrc does not load /etc/profile, at least mine didn't.
I commented out the check for xinitrc
in startwm.sh
:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
#if [ -f /etc/X11/xinit/xinitrc ]
#then
# . /etc/X11/xinit/xinitrc
# exit 0
#fi
This solved the problem for me and I didn't notice any difference in the function of XRDP.
add a comment |
I had this problem under 6.6. Don't know if the same under 7.
/etc/profile
sets system-wide environment variables and adds "sbin" paths for the "root" user. /etc/xrdp/startwm.sh
loads this file in the pre_start()
function which is executed at the bottom of the file.
But the top of /etc/xrdp/startwm.sh
looks like this:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
if [ -f /etc/X11/xinit/xinitrc ]
then
. /etc/X11/xinit/xinitrc
exit 0
fi
So, if /etc/X11/xinit/xinitrc
exists, /etc/xrdp/startwm.sh
executes it and terminates so none of the remaining setup is done. /etc/X11/xinit/xinitrc does not load /etc/profile, at least mine didn't.
I commented out the check for xinitrc
in startwm.sh
:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
#if [ -f /etc/X11/xinit/xinitrc ]
#then
# . /etc/X11/xinit/xinitrc
# exit 0
#fi
This solved the problem for me and I didn't notice any difference in the function of XRDP.
I had this problem under 6.6. Don't know if the same under 7.
/etc/profile
sets system-wide environment variables and adds "sbin" paths for the "root" user. /etc/xrdp/startwm.sh
loads this file in the pre_start()
function which is executed at the bottom of the file.
But the top of /etc/xrdp/startwm.sh
looks like this:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
if [ -f /etc/X11/xinit/xinitrc ]
then
. /etc/X11/xinit/xinitrc
exit 0
fi
So, if /etc/X11/xinit/xinitrc
exists, /etc/xrdp/startwm.sh
executes it and terminates so none of the remaining setup is done. /etc/X11/xinit/xinitrc does not load /etc/profile, at least mine didn't.
I commented out the check for xinitrc
in startwm.sh
:
# if xinitrc exists use it instead, it should load user prefferences
# including desktop environment specified in /etc/sysconfig/desktop
#if [ -f /etc/X11/xinit/xinitrc ]
#then
# . /etc/X11/xinit/xinitrc
# exit 0
#fi
This solved the problem for me and I didn't notice any difference in the function of XRDP.
answered Sep 22 '15 at 14:39
sthames42sthames42
1011
1011
add a comment |
add a comment |
I'm not sure if this will solve your issue, since it impacts Ubuntu with XRDP and XFCE4. Still, there is a chance it does, so let's see.
I was facing a similar problem: the PATH environment variable was different when I logged into the machine through SSH and through XRDP. Concretely, when I opened a Terminal window in XRDP (xterm
), the PATH variable was not set with local user paths (~/bin
, ~/.local/bin
, etc).
However, these paths were present when I logged in through SSH.
The problem was not in XRDP, but in how the Bash session is created with XTerm and with SSH. Since SSH creates a login session, the loaded files included /etc/environment
and ~/.profile
. In the latter, the paths I required were included.
This was not the case with XTerm. It creates a non-login bash session, and thus it loads /etc/bash.bashrc
and ~/.bashrc
.
The way I could fix it was simply to include the PATH initialization line from ~/.profile
into one of these two files. Since I wanted this to impact all the users in the machine, I included it into /etc/bash.bashrc
:
echo PATH="$HOME/bin:$HOME/.local/bin:$PATH" >> /etc/bash.bashrc
You can find more information about how works in man bash
add a comment |
I'm not sure if this will solve your issue, since it impacts Ubuntu with XRDP and XFCE4. Still, there is a chance it does, so let's see.
I was facing a similar problem: the PATH environment variable was different when I logged into the machine through SSH and through XRDP. Concretely, when I opened a Terminal window in XRDP (xterm
), the PATH variable was not set with local user paths (~/bin
, ~/.local/bin
, etc).
However, these paths were present when I logged in through SSH.
The problem was not in XRDP, but in how the Bash session is created with XTerm and with SSH. Since SSH creates a login session, the loaded files included /etc/environment
and ~/.profile
. In the latter, the paths I required were included.
This was not the case with XTerm. It creates a non-login bash session, and thus it loads /etc/bash.bashrc
and ~/.bashrc
.
The way I could fix it was simply to include the PATH initialization line from ~/.profile
into one of these two files. Since I wanted this to impact all the users in the machine, I included it into /etc/bash.bashrc
:
echo PATH="$HOME/bin:$HOME/.local/bin:$PATH" >> /etc/bash.bashrc
You can find more information about how works in man bash
add a comment |
I'm not sure if this will solve your issue, since it impacts Ubuntu with XRDP and XFCE4. Still, there is a chance it does, so let's see.
I was facing a similar problem: the PATH environment variable was different when I logged into the machine through SSH and through XRDP. Concretely, when I opened a Terminal window in XRDP (xterm
), the PATH variable was not set with local user paths (~/bin
, ~/.local/bin
, etc).
However, these paths were present when I logged in through SSH.
The problem was not in XRDP, but in how the Bash session is created with XTerm and with SSH. Since SSH creates a login session, the loaded files included /etc/environment
and ~/.profile
. In the latter, the paths I required were included.
This was not the case with XTerm. It creates a non-login bash session, and thus it loads /etc/bash.bashrc
and ~/.bashrc
.
The way I could fix it was simply to include the PATH initialization line from ~/.profile
into one of these two files. Since I wanted this to impact all the users in the machine, I included it into /etc/bash.bashrc
:
echo PATH="$HOME/bin:$HOME/.local/bin:$PATH" >> /etc/bash.bashrc
You can find more information about how works in man bash
I'm not sure if this will solve your issue, since it impacts Ubuntu with XRDP and XFCE4. Still, there is a chance it does, so let's see.
I was facing a similar problem: the PATH environment variable was different when I logged into the machine through SSH and through XRDP. Concretely, when I opened a Terminal window in XRDP (xterm
), the PATH variable was not set with local user paths (~/bin
, ~/.local/bin
, etc).
However, these paths were present when I logged in through SSH.
The problem was not in XRDP, but in how the Bash session is created with XTerm and with SSH. Since SSH creates a login session, the loaded files included /etc/environment
and ~/.profile
. In the latter, the paths I required were included.
This was not the case with XTerm. It creates a non-login bash session, and thus it loads /etc/bash.bashrc
and ~/.bashrc
.
The way I could fix it was simply to include the PATH initialization line from ~/.profile
into one of these two files. Since I wanted this to impact all the users in the machine, I included it into /etc/bash.bashrc
:
echo PATH="$HOME/bin:$HOME/.local/bin:$PATH" >> /etc/bash.bashrc
You can find more information about how works in man bash
answered Nov 7 '17 at 10:59
ErizoErizo
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f709777%2fxrdp-changing-path-environment-variable%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
There are a number of files that can be sourced that are completely unique to a SSH connection. I helped someone audit this last year and I think steering you in the direction of that answer will help eliminate a number possibilities. Please let us know when you've ruled out those possibilities and edit your question to contain all of the files you've checked.
– Andrew B
Jul 30 '15 at 19:49
Thanks for the reply Andrew. I edited my question to make it more clear. It's actually the reverse scenario from the post you linked to, that I can't explain. See edits for details.
– Justin Miller
Jul 30 '15 at 20:02
Can you provide a specific example of things "getting weird" as you put it? It might help us narrow it down.
– Andrew B
Jul 30 '15 at 20:02
Yep! Done. See Edit 2.
– Justin Miller
Jul 31 '15 at 12:15