如何透明地使用 GNU Screen

发布于 2024-07-13 05:24:20 字数 218 浏览 3 评论 0原文

我想以用户不知道它在那里的方式使用 GNU 屏幕。 这是为了帮助确保我正在编写的基于文本的管理应用程序一次只能由一个用户使用。 为了防止用户通过运行应用程序并在度假时保持运行来锁定其他人,我希望能够分离他们的会话并允许其他用户附加到它。

所以我的问题是:

  • 我可以将 .screenrc 中的转义键设置为 null,以便用户自己无法访问屏幕的任何功能吗?

I want to use GNU screen in such a way that the user doesn't know it's there. It's to help ensure that a text based management application that I'm writing can only be used by a single user at a time. To guard against against users locking everyone else out by running the application and going, leaving it running when going on holiday, I want to be able to detach their session and allow another user to attach to it.

So my questions is:

  • Can I set the escape key in .screenrc to null, so that the user can't access any of screen's functionality themselves?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

夜巴黎 2024-07-20 05:24:20

看起来 .screenrc 中的以下内容可以解决问题:

escape ''

这不会将转义字符设置为 ',而是完全禁用转义机制。

It looks like the following in .screenrc does the trick:

escape ''

This does not set the escape character to ', but disables the escape mechanism entirely.

倒数 2024-07-20 05:24:20

也许只需将 .screenrc 中的转义字符设置为 ASCII 表中无法通过键盘输入的模糊字符即可。 我认为字符 176 就是一个例子(或者尝试正常范围之外的任何其他字符):

escape ^°°

只需将其放入 .screenrc 文件中,您的用户将无法访问任何 screen 功能:

perl -e 'print "escape ^", chr(176), chr(176), "\n"' >> .screenrc

Maybe just set the escape character in .screenrc to an obscure character from the ASCII table which cannot by typed on a keyboard. I think the character 176 would be an example (or try any other one outside the normal range):

escape ^°°

Just put it in your .screenrc file, and your users won't be able to access any screen functionality:

perl -e 'print "escape ^", chr(176), chr(176), "\n"' >> .screenrc
忆梦 2024-07-20 05:24:20

阻止用户使用 Screen 的功能是不好的形式(除非您有运行应用程序的共享登录名)。

相反,让您的应用程序处理通过自动注销显示的用例,警告新的连接用户并为他们提供启动其他用户的选项,处理多个用户等。

Preventing the user from using the functionality of Screen is bad form (unless you have a shared login which runs your application).

Instead, make your application deal with the use case you've shown by autologout, warning new connecting users and giving them the option to boot the other user, handling multiple users, etc.

肤浅与狂妄 2024-07-20 05:24:20

考虑使用 detachtty/attachtty 而不是使用 screen

instead of using screen, consider using detachtty/attachtty

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文