Re: "Leaving" a connection open / Sessions
- From: comphelp@xxxxxxxxx (Todd H.)
- Date: 13 Sep 2006 21:43:13 -0500
sgb1010@xxxxxxxxxxx writes:
Greetings!
Is there a way to leave a connection open in SSH, something as a
'session' which can be restored later?
I think you're about to fall in love with Gnu screen.
My scenario is the following: I connect to a remote machine (which has
sshd) via SSH, run octave, run a long script (which will probably take
about a month to complete), hit Ctrl+Z, type BG. So far so good, my
application goes to background.
What I would like to do next would be to log out of this ssh connection
and, when I return (with the same user), be able to fg %1 and return to
the running program. Right now when I try to do this I get a message
saying I can't, because there are jobs running on the background.
Is there a way to accomplish this? Some configuration in sshd perhaps?
I wouldn't like to have to leave two machines turned on whereas one
would suffice.
ssh blah@remotehost
remotehost$ screen
[hit enter after swcreen's introductory comments]
remotehostinscreen$ . .bash_profile (if ya need to, screen doesn't always
fork as a login shell, so you may need to source this)
remotehostinscreen$ myfunprocess&
remotehostinscreen$ [Ctrl-a d]
[detached]
remotehost$ exit
Days later, from some completely different machine, reconnect to
remotehost via any method.
remotehost$ screen -r
remotehostinscreen$
you'll be right back where you were.
Think of screen as VNC for tty's. -r reconnects you. Ctrl-a
followed by d disconnects you. Or hell ust kill the terminal.
Screen is still there.
Enjoy! Screen rocks.
--
Todd H.
http://www.toddh.net/
.
- Follow-Ups:
- Re: "Leaving" a connection open / Sessions
- From: Ignoramus7715
- Re: "Leaving" a connection open / Sessions
- From: sgb1010
- Re: "Leaving" a connection open / Sessions
- From: Gustavo L. Fabro
- Re: "Leaving" a connection open / Sessions
- References:
- "Leaving" a connection open / Sessions
- From: sgb1010
- "Leaving" a connection open / Sessions
- Prev by Date: "Leaving" a connection open / Sessions
- Next by Date: Re: "Leaving" a connection open / Sessions
- Previous by thread: "Leaving" a connection open / Sessions
- Next by thread: Re: "Leaving" a connection open / Sessions
- Index(es):
Relevant Pages
|