How to ssh in, specify a few commands to execute and keep the session alive?

statik213

Golden Member
Oct 31, 2004
1,654
0
0
I'm writing a script and I'd like to ssh into a.b.c.d and execute the export command and keep the ssh terminal open after running the command.
The default behaviour is for ssh to quit after running the supplied command(s)....

Here's what I'm doing right now:
ssh -Y -l johndoe a.b.c.d "export DISPLAY=xxxxxxx"
 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
no can do, sending a command via ssh is to execute that command and close the session. If I assume what you are attempting to do is to open a session with X forwarding set when you login, then you want to execute 'ssh -X user@host'

 

statik213

Golden Member
Oct 31, 2004
1,654
0
0
Originally posted by: TonyRic
no can do, sending a command via ssh is to execute that command and close the session. If I assume what you are attempting to do is to open a session with X forwarding set when you login, then you want to execute 'ssh -X user@host'

wow thats exactly waht I wanted.... thanks for the tip!