LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2013, 03:34 AM   #1
dragonfly-uk
Member
 
Registered: Feb 2013
Posts: 36

Rep: Reputation: Disabled
Returning to an SSH connection.


Can anybody tell me is there a way that I can open an SSH connection, set of a task that is going to take several hours to run, close the connection.

Some time later, or even from a difference workstation, reconnect to the same SSH connection, and check the progress of the job I fired off??
 
Old 04-23-2013, 03:43 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

screen and tmux can be used for this. Basically you ssh to the remote machine, start a tmux or screen session, start yout program/task, then "detach" from screen or tmux. At this point you can either reattach to screen or tmux, or log out, and ssh back in later and reattach.

If your requirements are more basic and/or screen or tmux are not available, nohup may be enough. using nohup will ensure that even if your ssh connection is lost you program will continue to run.

I can't recommend any particular tutorial on these tools, but there are certainly many available on the web.

HTH,

Evo2.

Last edited by evo2; 04-23-2013 at 03:48 AM.
 
1 members found this post helpful.
Old 04-23-2013, 04:28 AM   #3
dragonfly-uk
Member
 
Registered: Feb 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
Thanks, had a quick look at Screen looks like it does what I want. Thanks for the help.
 
Old 04-23-2013, 05:51 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by dragonfly-uk View Post
Thanks, had a quick look at Screen looks like it does what I want. Thanks for the help.
No problem. BTW, I was a happy screen user for many years, then I found tmux: now I'm a very happy tmux user.

Evo2.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Client TCP socket recv returning 0 when server closes the connection dfbloemen Programming 3 06-21-2012 09:24 AM
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
ssh connection forces password change, then closes connection loadedmind Linux - Newbie 2 02-16-2011 01:24 PM
LXer: ssh-xfer: Quickly grabbing files over an existing SSH connection LXer Syndicated Linux News 0 08-08-2008 03:11 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:21 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