How to set specific value of DISPLAY variable on remote host with SSH but without command line parameters?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












In putty I can configure exact values for environment variables on remote host, for example



enter image description here



On Linux I have ~/.ssh/config file which contains entry like this



Host calculon
User dims


Is it possible and how to configure remote host environment variables on Linux in the same way i.e. without specifying them on command line or separate commands?



I can specify



SendEnv DISPLAY


in config, but this will require to set this variable on local host via separate command. This is both excessive and for DISPLAY variable is also a nonsense.



Also I have read about ~/.ssh/environment file and wrote this



dims@pterosaur:~$ cd .ssh
dims@pterosaur:~/.ssh$ cat environment
DISPLAY=pterosaur:0


but this has no effect (variable DISPLAY is not set on remote host).



Note that sshd is already configured to accept DISPLAY variable and accepts it normally from Putty. So the task is to configure Linux client in the same way.










share|improve this question



























    up vote
    0
    down vote

    favorite












    In putty I can configure exact values for environment variables on remote host, for example



    enter image description here



    On Linux I have ~/.ssh/config file which contains entry like this



    Host calculon
    User dims


    Is it possible and how to configure remote host environment variables on Linux in the same way i.e. without specifying them on command line or separate commands?



    I can specify



    SendEnv DISPLAY


    in config, but this will require to set this variable on local host via separate command. This is both excessive and for DISPLAY variable is also a nonsense.



    Also I have read about ~/.ssh/environment file and wrote this



    dims@pterosaur:~$ cd .ssh
    dims@pterosaur:~/.ssh$ cat environment
    DISPLAY=pterosaur:0


    but this has no effect (variable DISPLAY is not set on remote host).



    Note that sshd is already configured to accept DISPLAY variable and accepts it normally from Putty. So the task is to configure Linux client in the same way.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In putty I can configure exact values for environment variables on remote host, for example



      enter image description here



      On Linux I have ~/.ssh/config file which contains entry like this



      Host calculon
      User dims


      Is it possible and how to configure remote host environment variables on Linux in the same way i.e. without specifying them on command line or separate commands?



      I can specify



      SendEnv DISPLAY


      in config, but this will require to set this variable on local host via separate command. This is both excessive and for DISPLAY variable is also a nonsense.



      Also I have read about ~/.ssh/environment file and wrote this



      dims@pterosaur:~$ cd .ssh
      dims@pterosaur:~/.ssh$ cat environment
      DISPLAY=pterosaur:0


      but this has no effect (variable DISPLAY is not set on remote host).



      Note that sshd is already configured to accept DISPLAY variable and accepts it normally from Putty. So the task is to configure Linux client in the same way.










      share|improve this question















      In putty I can configure exact values for environment variables on remote host, for example



      enter image description here



      On Linux I have ~/.ssh/config file which contains entry like this



      Host calculon
      User dims


      Is it possible and how to configure remote host environment variables on Linux in the same way i.e. without specifying them on command line or separate commands?



      I can specify



      SendEnv DISPLAY


      in config, but this will require to set this variable on local host via separate command. This is both excessive and for DISPLAY variable is also a nonsense.



      Also I have read about ~/.ssh/environment file and wrote this



      dims@pterosaur:~$ cd .ssh
      dims@pterosaur:~/.ssh$ cat environment
      DISPLAY=pterosaur:0


      but this has no effect (variable DISPLAY is not set on remote host).



      Note that sshd is already configured to accept DISPLAY variable and accepts it normally from Putty. So the task is to configure Linux client in the same way.







      ssh configuration environment-variables






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 4 '17 at 15:09

























      asked Aug 31 '17 at 11:33









      Dims

      3151728




      3151728




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Configuration is documented in man 5 ssh_config.



          SendEnv can be used if the server supports and is configured to accept it:




          SendEnv



          Specifies what variables from the local environ(7) should be sent to the server. Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables. Refer to AcceptEnv in sshd_config(5) for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.




          If that is not possible you can also configure remote host shell with your environmental variables (using .profile etc., for bash see documentation on bash startup files).






          share|improve this answer


















          • 1




            This will pass current environment variable to remote host, but not set it
            – Dims
            Aug 31 '17 at 11:50










          • You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
            – sebasth
            Aug 31 '17 at 11:53










          • What about any other ways? But without writing a wrapper.
            – Dims
            Sep 4 '17 at 15:11










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f389469%2fhow-to-set-specific-value-of-display-variable-on-remote-host-with-ssh-but-withou%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Configuration is documented in man 5 ssh_config.



          SendEnv can be used if the server supports and is configured to accept it:




          SendEnv



          Specifies what variables from the local environ(7) should be sent to the server. Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables. Refer to AcceptEnv in sshd_config(5) for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.




          If that is not possible you can also configure remote host shell with your environmental variables (using .profile etc., for bash see documentation on bash startup files).






          share|improve this answer


















          • 1




            This will pass current environment variable to remote host, but not set it
            – Dims
            Aug 31 '17 at 11:50










          • You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
            – sebasth
            Aug 31 '17 at 11:53










          • What about any other ways? But without writing a wrapper.
            – Dims
            Sep 4 '17 at 15:11














          up vote
          1
          down vote













          Configuration is documented in man 5 ssh_config.



          SendEnv can be used if the server supports and is configured to accept it:




          SendEnv



          Specifies what variables from the local environ(7) should be sent to the server. Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables. Refer to AcceptEnv in sshd_config(5) for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.




          If that is not possible you can also configure remote host shell with your environmental variables (using .profile etc., for bash see documentation on bash startup files).






          share|improve this answer


















          • 1




            This will pass current environment variable to remote host, but not set it
            – Dims
            Aug 31 '17 at 11:50










          • You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
            – sebasth
            Aug 31 '17 at 11:53










          • What about any other ways? But without writing a wrapper.
            – Dims
            Sep 4 '17 at 15:11












          up vote
          1
          down vote










          up vote
          1
          down vote









          Configuration is documented in man 5 ssh_config.



          SendEnv can be used if the server supports and is configured to accept it:




          SendEnv



          Specifies what variables from the local environ(7) should be sent to the server. Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables. Refer to AcceptEnv in sshd_config(5) for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.




          If that is not possible you can also configure remote host shell with your environmental variables (using .profile etc., for bash see documentation on bash startup files).






          share|improve this answer














          Configuration is documented in man 5 ssh_config.



          SendEnv can be used if the server supports and is configured to accept it:




          SendEnv



          Specifies what variables from the local environ(7) should be sent to the server. Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables. Refer to AcceptEnv in sshd_config(5) for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.




          If that is not possible you can also configure remote host shell with your environmental variables (using .profile etc., for bash see documentation on bash startup files).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 8 mins ago

























          answered Aug 31 '17 at 11:43









          sebasth

          7,44631745




          7,44631745







          • 1




            This will pass current environment variable to remote host, but not set it
            – Dims
            Aug 31 '17 at 11:50










          • You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
            – sebasth
            Aug 31 '17 at 11:53










          • What about any other ways? But without writing a wrapper.
            – Dims
            Sep 4 '17 at 15:11












          • 1




            This will pass current environment variable to remote host, but not set it
            – Dims
            Aug 31 '17 at 11:50










          • You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
            – sebasth
            Aug 31 '17 at 11:53










          • What about any other ways? But without writing a wrapper.
            – Dims
            Sep 4 '17 at 15:11







          1




          1




          This will pass current environment variable to remote host, but not set it
          – Dims
          Aug 31 '17 at 11:50




          This will pass current environment variable to remote host, but not set it
          – Dims
          Aug 31 '17 at 11:50












          You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
          – sebasth
          Aug 31 '17 at 11:53




          You could write alias or wrapper for your local shell to set those variables. I am not aware that you can directly set those in ssh_config.
          – sebasth
          Aug 31 '17 at 11:53












          What about any other ways? But without writing a wrapper.
          – Dims
          Sep 4 '17 at 15:11




          What about any other ways? But without writing a wrapper.
          – Dims
          Sep 4 '17 at 15:11

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f389469%2fhow-to-set-specific-value-of-display-variable-on-remote-host-with-ssh-but-withou%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay