Skip to content

Instantly share code, notes, and snippets.

@libitte
Created December 9, 2014 16:46
Show Gist options
  • Save libitte/0b182f67d500d90228bd to your computer and use it in GitHub Desktop.
Save libitte/0b182f67d500d90228bd to your computer and use it in GitHub Desktop.
screen -r で attach できないときの対処 ref: http://qiita.com/libitte/items/e048a0e52aa6266dcfdb
$ screen -ls
There are screens on:
11119.pts-8.ip-10-10-10-10 (Attached)
11520.pts-1.ip-10-10-10-20 (Detached)
2 Sockets in /var/run/screen/S-foobar-user.
$ screen -r 11119.pts-8.ip-10-10-10-10
There is a screen on:
11119.pts-8.ip-10-10-10-10 (Attached)
There is no screen to be resumed matching 11119.pts-1.ip-10-10-10-10.
$ ps aux|grep pts|grep sshd
foobar-user 12393 0.0 0.0 111576 1992 ? S 15:53 0:00 sshd: ec2-user@pts/8
foobar-user 12685 0.0 0.0 111576 1992 ? S 16:10 0:00 sshd: ec2-user@pts/0
foobar-user 12788 0.0 0.0 114500 896 pts/0 S+ 16:12 0:00 grep sshd
$ kill 12393
# Attach したいセッションが(Detached) になっていることを確認
$ screen -ls
# attachする
$ screen -r 11119.pts-8.ip-10-10-10-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment