LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2009, 12:23 PM   #1
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
how to review disconnected ssh shell


I have connected my server from remote by ssh and i have executed a command but unfortunately my ssh connection has disconnected, but still the command that i have executed is in progress, how can i recall and view that existing process at my remote ssh shell.

Quote:
[root@om ~]# w
22:02:11 up 1 day, 6:03, 2 users, load average: 0.01, 0.06, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.16.1 17:53 4:04m 5:59 5:59 ab -n 10000000 -c 10 192.168.1.2:8080/load-test/load-test.jsp
root pts/1 192.168.16.1 21:45 0.00s 0.01s 0.01s -bash
Actually i have to get final statistics of ab tool. Please anybody help me.

Thanks
 
Old 06-03-2009, 01:41 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by kirukan View Post
I have connected my server from remote by ssh and i have executed a command but unfortunately my ssh connection has disconnected, but still the command that i have executed is in progress, how can i recall and view that existing process at my remote ssh shell.

Actually i have to get final statistics of ab tool. Please anybody help me.

Thanks
Unfortunately that isn't possible. You can't connect to a disconnected session.

The normal method for working around that is to use screen.

Type screen at the prompt, it will bring you back to a prompt, execute your programs as normal, when your ready to disconnect hit ctrl-a d and the session will disconnect (if you get disconnected it's effectively the same result). When you wish to reconnect to the session you would execute screen -r and you would resume control of the session. As long as you've disconnected from your screen you can logout, change terminals, etc.

As a general rule I run screen on login first thing and when I'm done close it (exit/ctrl-d) if I don't need to be able to reconnect just in case something happens and I get disconnected.

Of course screen doesn't help if the machine reboots or something of that nature... but it will prevent the agony of network connects and switching between multiple computers (work and home).

Last edited by rweaver; 06-03-2009 at 01:42 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there anyway to resurrect or connect to a shell that got disconnected? Emerge Help justin-goldberg Linux - Server 1 12-15-2008 12:14 PM
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
LXer: Book Review Shell Script Pearls LXer Syndicated Linux News 0 09-04-2007 07:41 PM
ssh connection is disconnected suddenly powah Linux - Networking 1 12-15-2005 12:24 PM
ssh & sftp, DISCONNECTED:corrupted MAC on input frieza Linux - Networking 6 02-16-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 AM.

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