How to set specific value of DISPLAY variable on remote host with SSH but without command line parameters?
Clash 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
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
add a comment |Â
up vote
0
down vote
favorite
In putty I can configure exact values for environment variables on remote host, for example
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
add a comment |Â
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
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
In putty I can configure exact values for environment variables on remote host, for example
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
ssh configuration environment-variables
edited Sep 4 '17 at 15:09
asked Aug 31 '17 at 11:33
Dims
3151728
3151728
add a comment |Â
add a comment |Â
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 toAcceptEnv
insshd_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).
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 inssh_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
add a comment |Â
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 toAcceptEnv
insshd_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).
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 inssh_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
add a comment |Â
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 toAcceptEnv
insshd_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).
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 inssh_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
add a comment |Â
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 toAcceptEnv
insshd_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).
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 toAcceptEnv
insshd_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).
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 inssh_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
add a comment |Â
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 inssh_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
add a comment |Â
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
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
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
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
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