大网数据广告活动
服务器运维问答

Owner of screen session

· 52CE 我爱测

When I logged in a server and issue a 'screen -list' commands it gives the following result - 31917.pts-5.office (Detached) 31844.pts-0.office (Detached) But it is sometimes important to know who has start the screen session - eg…

问题原文

原帖链接 · Razib · CC BY-SA 3.0

When I logged in a server and issue a 'screen -list' commands it gives the following result -

31917.pts-5.office      (Detached)
31844.pts-0.office      (Detached) 

But it is sometimes important to know who has start the screen session - eg.- as system admin may want to kill some specific screen session and when it's important to know who start the session. Is there any way to know who is initiator/owner of the screen session?

Thanks

已采纳解答

原帖链接 · user9517 · CC BY-SA 3.0

The screen -ls | screen -list commands only show you your own screen sessions even for root. As far as I know that's as good as it gets for screen itself.

If you want to see which screen sessions have been started by which users look in each users directory in /var/run/screen/

ls -lR /var/run/screen
/var/run/screen:
total 0
drwx------ 2 iain iain 80 Feb 20 18:14 S-iain
drwx------ 2 root root 60 Feb 20 18:19 S-root

/var/run/screen/S-iain:
total 0
prw------- 1 iain iain 0 Feb 20 18:13 4093.pts-0.host1
prw------- 1 iain iain 0 Feb 20 18:14 4105.pts-0.host1

/var/run/screen/S-root:
total 0
prw------- 1 root root 0 Feb 20 18:19 4128.pts-0.host1

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。