让用户从 CL 重新启动,或者在不成为 root 的情况下从 CL 重新启动

发布于 2024-12-15 08:22:44 字数 314 浏览 5 评论 0原文

我正在开发一个 kiosk gui,用 ruby​​/gtk 编写并使用 ubuntu。我希望能够从 ruby​​/gtk gui 中重新启动——具体来说,我想让刷管理卡的人选择重新启动计算机作为他们的管理选项之一。我不想更普遍地授予这些用户 root 访问权限。有没有办法执行以下操作之一: 1) 在没有 root 权限的情况下从命令行重新启动,或者 2)更改/减少从命令行重新启动所需的权限级别,以便我可以让人们单击按钮重新启动,而不必担心他们对系统的更广泛访问,或者 3)(我怀疑这是可能的)也许以某种方式从gtk内部或者以编程方式登录到root以使用重新启动命令,而不会将密码暴露给任何可以查看源代码的人。

I am working on a kiosk gui, written in ruby/gtk and using ubuntu. I'd like to be able to reboot from within the ruby/gtk gui -- specifically, I want to let people who swipe administrative cards choose to reboot the machine as one of their administrative options. I do not want to give these users root access more generally. Is there a way to do one of the following:
1) reboot from command line without root permission, or
2) change/reduce the level of permission required to reboot from command line so I can let people click on a button to reboot without worrying about their broader access to the system, or
3) (I doubt this is possible) perhaps somehow from within gtk or however programmatically log in to root to use the reboot command without exposing the password to anyone who can view the source code.

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

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

发布评论

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

评论(1

抱着落日 2024-12-22 08:22:44

您可以将您的用户配置为允许通过 sudo 使用 shutdown 命令。这可能会做你想要的。

You could configure your user to be allowed to use the shutdown command via sudo. That would probably do what you want.

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