Mailinglist Archive: opensuse (878 mails)

< Previous Next >
[opensuse] Re: How start a remote job and detach the session, and re-connect later?
  • From: Joachim Schrod <jschrod@xxxxxxx>
  • Date: Fri, 13 Sep 2013 00:35:47 +0200
  • Message-id: <l0tfjr$sai$1@ger.gmane.org>
On 09/12/13 04:02, Carlos E. R. wrote:

I want to start an ssh session, start a command, get out, and later
connect again via ssh and pick up the still running program and
output.

Does the repeat-connection needs to be with ssh?

Mmm... I didn't say that the client machine usually hibernates
between sessions. The idea is to ssh-in, start something in an
xterm with ssh, when needed hibernate or poweroff (the client
side), and take again the same terminal hours or even days later.

Then it doesn't help; you'll need to use something like screen.

Within an ssh session, typing "~<C-z>" (that's the key with an
tilde ~, and Ctrl-Z following) suspends the ssh session. One has an
active shell back at the command issuing server then.[*] With the
command "fg" one can resume the ssh session.

Interesting! Not of use for me this time, I think, but interesting.
I'll write all this in my notes, so that I remember next time.

However, the choice of "~" is awkward in a Spanish keyboard: to
type it I need "[Alt-gr][4]" (alt-gr is the right hand "Alt" key),
so the entire combo becames more complicated.

Same here in Germany, it's [Alt-gr][+] on German keyboards.

[*] If one has several cascadet ssh sessions, it's an "interesting"
game to guess the amount of tildes before <Ctrl-Z> that one needs
to get at an intermediate ssh session.

Indeed...! I always wondered how to do that if needed. I never had
to, but it is interesting to know.

Ever wondered why typing a ~ at the start of a line isn't output
immediately? It's an ssh escape character. To see the possible
options, type "~?" at the start of a line. Very important is also
"~." to terminate a session if it hangs remotely and doesn't accept
Ctrl-C, Ctrl-Z, or such.

Cheers,
Joachim

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: jschrod@xxxxxxx

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups