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;








0















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










share|improve this question
























  • 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

















0















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










share|improve this question
























  • 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













0












0








0








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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










2 Answers
2






active

oldest

votes


















0














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.






share|improve this answer






























    0














    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






    share|improve this answer























      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      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.






      share|improve this answer



























        0














        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.






        share|improve this answer

























          0












          0








          0







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 22 '15 at 14:39









          sthames42sthames42

          1011




          1011























              0














              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






              share|improve this answer



























                0














                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






                share|improve this answer

























                  0












                  0








                  0







                  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






                  share|improve this answer













                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 7 '17 at 10:59









                  ErizoErizo

                  11




                  11



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                      Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                      Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020