LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   connecting to already existing consoles using putty (https://www.linuxquestions.org/questions/linux-newbie-8/connecting-to-already-existing-consoles-using-putty-729786/)

chaitanya1982 06-01-2009 03:59 AM

connecting to already existing consoles using putty
 
Hi,

I have a question. I had connected to one linux machine using putty. While working the network was went down. Again I connected to the same machine after some time.

Now I want to connect to my previous session which was opened in last time. The out put of the w command showing that the console is running. Is there any way to switch between those console which are already opened.
Please help in this regard. The W command output is as follows. Thanks in advance.
[root@fedora35 ~]# w
04:41:46 up 11 days, 50 min, 4 users, load average: 0.09, 0.03, 0.20
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 :0.0 21May09 5days 0.08s 0.08s bash
root pts/1 :0.0 21May09 6days 53.05s 0.40s bash
root pts/2 192.168.230.155 02:17 1:49m 0.07s 0.02s vi runsed
root pts/3 192.168.230.155 04:36 1.00s 0.03s 0.00s w

blacky_5251 06-01-2009 04:03 AM

No. If you want to be able to do this, then when you first connect from your remote location, you should immediately run "screen". This will keep your session active through network disconnects and allow you to resume any detached sessions from any location (not necessarily from where you were).
Code:

man screen
Your current sessions can't be recovered.

chaitanya1982 06-01-2009 04:25 AM

Thanks for your reply.

I ran screen command now. If again it disconnects, How can I connect to my previous session.

blacky_5251 06-01-2009 04:50 AM

Read the man page as suggested (at the prompt, enter "man screen").

A short intro:-
1. To detach from an existing screen session, press Control-A followed by D.
2. To see which screens you have running, type "screen -ls".
3. If you only have one detached screen, use "screen -r" to resume it.
4. If you have more than one, the use "screen -r <screen-name>" where <screen-name> is replaced by the screen named returned from "screen -ls".

Again, read the man page!

chaitanya1982 06-01-2009 04:54 AM

Thanks for your reply. I will try this.


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