User Tools

Site Tools


term:access_other_user_s_screen_session

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

term:access_other_user_s_screen_session [2017/04/03 15:06] – created peterterm:access_other_user_s_screen_session [2019/12/04 21:51] (current) – removed peter
Line 1: Line 1:
-====== Term - Access other user's screen session ====== 
- 
-An admin might want to check what another user is running using screen.  The best you can see even as root using ps, is just the name of the command, like below: 
- 
-<code bash> 
-sudo ps awxuf | grep -i screen 
- 
-root      1135  0.0  0.0  13636   976 pts/1    S+   13:27   0:00                          \_ grep --color=auto -i screen 
-john   4245  0.0  0.0 387364 16668 ?        Sl   Feb02   0:06  |       \_ gnome-screensaver 
-1001      6762  0.0  0.0 347384 10428 ?        Sl   Feb02   0:00              \_ gnome-screensaver 
-john    625  0.0  0.0  31320  1568 ?        Ss   11:57   0:00 SCREEN -S test 
-</code> 
- 
- 
-<code bash> 
-pstree -Gap 625 
- 
-screen,625 -S test 
- 
-  └─bash,626 
-</code> 
- 
- 
-When you try to access the screen session using other user, this is usually the error: 
- 
-<code bash> 
-sudo -u john screen -r 625 
- 
-Cannot open your terminal '/dev/pts/1' - please check. 
-</code> 
- 
-This is because, your terminal: /dev/pts/1 is only readable and writable to the owner of the terminal: 
- 
- 
-<code bash> 
-ls -lh /dev/pts/1 
- 
-crw--w---- 1 john tty 136, 1 Feb  12 13:30 /dev/pts/1 
-</code> 
- 
-To overcome this, simply allow read and write to the terminal, to all users: 
- 
-<WRAP important> 
-This needs to be run from the user who's screen you want to read. 
-</WRAP> 
- 
-<code bash> 
-chmod o+rw /dev/pts/1 
-ls -lh /dev/pts/1 
- 
-crw--w-rw- 1 john tty 136, 1 Feb  12 13:32 /dev/pts/1 
-</code> 
- 
-Once that done, you can use sudo to access the screen of the other user: 
- 
-<code bash> 
-sudo -u john screen -r 625 
-</code> 
- 
- 
  
term/access_other_user_s_screen_session.1491231992.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki