attach process from another ssh session


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users attach process from another ssh session
# 1  
Old 04-05-2008
attach process from another ssh session

Hi,

I was logged in on a server, by ssh, with a vim open, when the battery of my laptop got empty.
When I return to the server by ssh, I can see my previous ssh session still open, and the vim process running (ttyp0). Is there a way to attach that vim to my new session (ttyp4)?

Here's part of the output of ps ax -e:
Code:
25658 ?        Ss     0:00 sshd: a7@ttyp0
16964 ttyp0    Ss     0:00 -bash
13113 ttyp0    S      0:00 bash
32378 ttyp0    S+     0:00 vi httpd.conf
  989 ?        Ss     0:00 sshd: a7@ttyp4
11880 ttyp4    Ss     0:00 -bash
32600 ttyp4    S      0:00 bash

I know screen, but vim wasn't started in a screen session....

Thanks in advance

Raph
# 2  
Old 04-05-2008
To the best of my knowledge, it can't be done.
# 3  
Old 05-05-2009
retty

use retty or screen.
I couldn't make screen do this for me but it seems it could, but retty woks, see "man retty" for bugs , it has some bugs!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Attach process with port 2222

Hi Team, is there any way, I can start any process for e.g. run a shell script (infinite loop) and attach it to port 2222? I am trying to create a scenario where an application will start running at port 2222 and I will telnet the same to confirm, application port is listening. So,... (1 Reply)
Discussion started by: vivekpandit7
1 Replies

2. Programming

dbx - attach to process, break when crash

Hey everyone, I have a process that is crashing, and I'd like to have some way to see where it crashes. Is this possible? (2 Replies)
Discussion started by: ctote
2 Replies

3. UNIX for Dummies Questions & Answers

SSH session

I ran a job using SSH and then used screen command followed by space bar. Then I ran the job. But after some hours, the internet connection was lost.This had happened to me before. I used to run the whole job again. Today I came across the fact that I could restart the jobs without having to do it... (2 Replies)
Discussion started by: nellierd
2 Replies

4. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

5. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

6. UNIX for Advanced & Expert Users

How to attach an xterm to a process/thread ?

Hi folks, I would like to know how to hook up an xterm to another process. Here is a high level view of what I am looking for 1. Main program starts 2. It creates an new xterm window 3. It then forks a second process & passes the xterm handle to it 4. The second process uses the second... (4 Replies)
Discussion started by: RipClaw
4 Replies

7. Shell Programming and Scripting

Finding out if you are in an ssh session

Hey, I'm trying to build customized behavior in a bash script for when it is run within an ssh session. This is how I'm finding out if the current session is ssh: USER=`whoami` ... (3 Replies)
Discussion started by: neked
3 Replies

8. Shell Programming and Scripting

starting a bash session as child process to another bash session from a process

Hi I want to do something that might sound strange. I have a code that in written in C and is executed at startup (it's a custom process). It occasionally calls some bash scripts. The process doesn't have any terminal associated with it. One thing I don't know how to do is to start a... (5 Replies)
Discussion started by: alirezan
5 Replies

9. Solaris

mbx_bad_handle during ssh -X session

We have a Solaris 10 server that we're migrating an old Cadre Teamwork application to. We find that when users on Sun workstations use ssh -X <username>@<new server> and run Teamwork on this new server it is fine. When cygwin users and linux users run ssh -X to get to this new platform they... (0 Replies)
Discussion started by: pzxkys
0 Replies

10. Shell Programming and Scripting

scripting an ssh session?

I know the root login/password for a machines, and I want to automate some commands like this from each: ssh root@remoteHost1 "tail /var/log/messages" ssh root@remoteHost2 "tail /var/log/messages" ssh root@remoteHost3 "tail /var/log/messages" ssh root@remoteHost4 "tail /var/log/messages" ssh... (2 Replies)
Discussion started by: jjinno
2 Replies
Login or Register to Ask a Question