LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-19-2008, 08:43 PM   #1
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Rep: Reputation: 15
Take over an ssh session.


I was wondering if there is a way to take over an ssh session. Here is the setup. I opened an ssh session from my pc at work, I used elinks to start downloading a file, the file is a 3gb file. Now I'm home and I want to move that ssh session to my laptop on my home network.


Is there a way to do this?
 
Old 05-19-2008, 10:35 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,830
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Not after the fact.

There is a tool called "screen" that you can start any command on. Once started you can attach to the same "screen" session from another terminal - you can even shutdown the terminal on which you started the original session. This is typically what I do if I need to start something while at work and access the same session from home later.
 
Old 05-19-2008, 11:35 PM   #3
tox2ik
LQ Newbie
 
Registered: Nov 2004
Location: norway
Distribution: gentoo
Posts: 23

Rep: Reputation: 15
sdr

go like this:
Code:
alias sdr="screen -DR"
sdr [name]
top
now press: CTRL + A + D
to attach the screen again anywhere (assuming you have the sdr alias there too) type

Code:
sdr [name]
 
Old 05-20-2008, 07:00 AM   #4
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Original Poster
Rep: Reputation: 15
I will have to give it a shot today thank you.
 
Old 05-20-2008, 10:36 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,830
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Some notes on screen:

screen -list - Shows screen session names
screen -S <name> - Starts screen session and gives it <name> as name.
screen -x <pid> - Attaches to existing screen session with PID of <pid>
Ctrl-A - Main command to use within screen. Selected options:
Ctrl-A ? - Gives a list of all options
Ctrl-A 0 - Goes to first window within a screen session.
Ctrl-A 1 - Goes to second window within a screen session.
Ctrl-A <n> - Goes to nth window within a screen session.
Doing exit from within a screen session will fall back to previous window.
Doing exit from all windows in screen session will terminate screen.
Closing window that has a screen session will leave it running and detached.

I haven't tried the alias configuration noted by other poster. Note that the "top" he puts there is a separate command presumably he is listing that to give you an example of something that he has run under screen. Unless you expect to be doing this all the time I'd recommend against setting up the alias as you might not remember its name 6 months from now when you next do it whereas screen is something that should appear quickly on a google search.
 
Old 07-17-2008, 06:06 PM   #6
milasch
LQ Newbie
 
Registered: May 2005
Location: Toronto, ON
Distribution: Ubuntu 8.04
Posts: 24

Rep: Reputation: 15
That would be great to know before I started my download! lol... I'm googling for a while now how to take over a process itself, if there is such a thing... something like: screen --takeover [pid]... because I also have started a big download and have no idea how it's going. Any ideas?
 
Old 07-17-2008, 06:37 PM   #7
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
If you used "wget" for it - just "CTRL-C" (interrupt) it - and you can always restart it with "wget -c your_url".
...this time in a screen session...

Firefox also has the ability to resume interrupted downloads. (Menu: Tools --> Downloads)

Last edited by jomen; 07-17-2008 at 06:42 PM.
 
Old 07-18-2008, 07:33 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,830
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Quote:
Originally Posted by milasch View Post
That would be great to know before I started my download! lol... I'm googling for a while now how to take over a process itself, if there is such a thing... something like: screen --takeover [pid]... because I also have started a big download and have no idea how it's going. Any ideas?
In a word: No.

Since the thread is a couple of months old I'll assume you didn't search for a solution BEFORE you started.

At least you'll know for future downloads.
 
Old 07-18-2008, 08:20 AM   #9
milasch
LQ Newbie
 
Registered: May 2005
Location: Toronto, ON
Distribution: Ubuntu 8.04
Posts: 24

Rep: Reputation: 15
Now, guess what? as soon as I click "Submit reply" i figured my download was completed... I guess I'm still not used to download stuff at 1.1mbps... It gets me thinking, once (more than 13 years ago) I installed a big brand software at home using 52 floppy disks, took me over 6 hours, now I download almost a floppy disk/second with a so so connection.

Last edited by milasch; 07-18-2008 at 08:21 AM. Reason: correcting othography
 
  


Reply


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 session bkone Linux - Newbie 3 10-17-2007 02:34 PM
How to connect to SSH session? Micro420 Linux - General 2 07-28-2006 03:23 AM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration