Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-09-2007, 05:33 PM   #1
Registered: Aug 2005
Distribution: Suse
Posts: 53

Rep: Reputation: 15
recover ssh session

I sometimes run ssh -Y (or -X) from school wirelessly to my home machine, and lose the connection. Once I get home when I run ps aux, I can see the "session" is still alive. I'd love to be able to reconnect to it now that I'm home and continue my work. I tried "jobs" and nothing shows up (so that I could possibly try "fg jobspec").

Does anyone know how I could reconnect to the same ssh session that was cut off?
Old 02-10-2007, 09:00 AM   #2
Registered: Feb 2003
Location: Richmond VA
Distribution: Slackware 11 -- CentOS 4.4
Posts: 115

Rep: Reputation: 15
see docs for "screen"

a soon as you're connected thru ssh, start screen. You can open multiple screens with `Control+A c` (and this can be customized if you don't want to change your emacs style key bindings).

When you lose the connection, screen keeps everything the way you last saw it. In your example you would come home and type `screen -R` to restore.

I don't usually start gui apps from within a screen session, though there may be a way to do it.

Old 02-10-2007, 07:45 PM   #3
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Check out the bottom from this site. It might work for you.



session, ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh -> perl -> spawn background proces hangs ssh session rhoekstra Programming 2 04-25-2006 02:05 AM
How to run a program in an ssh session that will run after you close out the session? dr_zayus69 Linux - Networking 5 03-05-2006 08:15 PM
persistent ssh session apepost Linux - Networking 4 11-12-2005 01:16 AM
how to recover control session ? superstition Linux - General 1 08-23-2005 07:57 PM
xwindows in ssh session ravneetsoin Linux - Software 2 08-12-2004 05:59 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration