43
13
How can I pass a value into an ssh command, such that the environment that is started on the host machine starts with a certain environment variable set to my choosing?
EDIT: The goal is to pass the current kde desktop ( from dcop kwin KWinInterface currentDesktop ) to the new shell created so that I can pass back an nfs locations to my JEdit instance on the original server which is unique for each KDE desktop. ( Using a mechanism like emacsserver/emacsclient)
The reason multiples ssh instances can be in flight at one time is because when I'm setting up my environment, I'm opening a bunch of different ssh instances to different machines.
2This answer doesn't really seem to answer the question. – intuited – 2010-06-17T19:54:13.770
1This will break if two processes are trying to do this with different sets of values concurrently – nafg – 2019-03-28T03:47:49.210
can you please add an example of what the format of ~/.ssh/environment file is? – Alexander Mills – 2019-04-29T22:10:32.823
3the variable needs to change potentially every ssh call – Ross Rogers – 2009-09-29T23:03:29.760
1Might be better to describe what you're trying to do and why. There could be other solutions. The environment file would have to be dynamically generated on each ssh call, which isn't impossible. – EmmEff – 2009-09-29T23:31:18.347
What is going to change? The values of those variables or even their names? – innaM – 2009-09-30T06:19:05.143
darn. I tried this solution, but I don't have access the sshd config file and putting vars in ~/.ssh/environment or ~/.ssh2/environment doesn't work. I guess I'm going to use a kludge where I leave this variable on an nfs disk and then snarf it up with my ~/.tcsh setup file. – Ross Rogers – 2009-09-30T18:46:16.640