0



I'm using secureCRT to ssh to Linux based server.
I use "screen" command to keep my sessions alive.
But things are becoming strange when I using two PC, OK, here's the scene:

On PC-A, start a new screen session named "test";
On PC-B, type screen -D -r test

Hopefully, I'd like to see the 'test' session detached on PC-A, and re-attached to PC-B.
That works, but when PC-A got remotely detached by PC-B, PC-A lost its connection to server.
Just reconnect will be okay, sure, but I'm still want to know why PC-A lost its connection.

Here's the command log of PC-A

[@PC-A ~]$ screen           

[remote power detached]
Screen session of test
ended.

Press Ctrl+C to cancel or Enter to reconnect immediately.
Reconnecting in 1 seconds...



Last login: Fri Mar  8 21:16:50 2013 from 10.129.215.167
[@PC-A ~]$ _ 


And here is my .screenrc file:

#se the startup message
startup_message off
term xterm
##set a biger buffer
defscrollback 4096
#statusbar
hardstatus alwayslastline
shell zsh
shelltitle "$|zsh"
hardstatus alwayslastline "%{=b}%{Y}%-w%{.BW}%10>%n*%t%{-}%+w%< %=%{kG}(F5)New (F6)Kill (F7)Rename (F8)Next           %C%A %D, %Y-%m-%d    "
vbell off

## w to show the window list
bind w windowlist -b
bind ^w windowlist -b
##initial apps to run
screen
select 0

attrcolor u "-u B"
sessionname test
autodetach off

#shot-key bindings
bindkey -k k5 screen 
bindkey -k k6 kill 
bindkey -k k7 title 
bindkey -k k8 next 
Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
shao
  • 31
  • 3

1 Answers1

0

screen by default launches with multiuser set to off. That means when a user logs in, it kicks the previous one out. Change that to your .screenrc and you should be fine.

http://linux.die.net/man/1/screen (search for multiuser).

Nick Andriopoulos
  • 10,313
  • 6
  • 32
  • 56
  • In this issue, user is only me. Problem is when PC-A got kicked by PC-B, it lost its network connection. – shao Mar 08 '13 at 14:22