下面是尝试使用 gnu screen 时发生的情况。从本质上讲,一切正常,直到我 su 作为另一个用户。然后我得到一个Cannot open your terminal '/dev/pts/7' - please check.错误
l413:~$ ssh sbird@example.com
sbird@example.com password:
sbird@example:~$ screen
[screen is terminating]
sbird@example:~$ su - gradplan
Password:
gradplan@example:~$ screen
Cannot open your terminal '/dev/pts/7' - please check.
gradplan@example:~$
Run Code Online (Sandbox Code Playgroud)
如何以 sbird、su 登录到 gradplan,并且仍然使用 screen?
小智 11
键入script /dev/null开始之前screen。
$ su - gradplan
$ screen
Cannot open your terminal '/dev/pts/15' - please check.
$ script /dev/null
Script started, file is /dev/null
$ screen
# do whatever inside the screen
[detached]
$
Run Code Online (Sandbox Code Playgroud)
参考:ServerFault:为什么将“脚本”重定向到 /dev/null/ 允许“屏幕”在作为另一个用户使用时工作?
小智 4
直接回答你的问题:
\n\nssh sbird@example.com su grandplan -c \xe2\x80\x9cscript /dev/null -qc \\"screen\\""
不要更改 /dev/pts/X 上的权限 - 它只会引入不必要的安全漏洞。
\n| 归档时间: |
|
| 查看次数: |
2452 次 |
| 最近记录: |