LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-09-2007, 04:33 PM   #1
petersk
Member
 
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?
Regards,
Kurt
 
Old 02-10-2007, 08:00 AM   #2
jxi
Member
 
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.

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

Rep: Reputation: 61
Check out the bottom from this site. It might work for you.
http://www.suso.org/docs/shell/ssh.sdf

Brian
 
  


Reply

Tags
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 01: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 07:15 PM
persistent ssh session apepost Linux - Networking 4 11-12-2005 12:16 AM
how to recover control session ? superstition Linux - General 1 08-23-2005 06:57 PM
xwindows in ssh session ravneetsoin Linux - Software 2 08-12-2004 04:59 PM


All times are GMT -5. The time now is 05:42 AM.

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