如何监禁linux用户

发布于 2024-07-20 13:48:16 字数 79 浏览 4 评论 0 原文

有没有类似 chroot 但针对用户的东西?

我们即将向客户端授予对我们服务器的访问权限,并希望他们只能看到我们允许的目录。

Is there something similar to chroot, but for users?

We are about to grant access to our servers for a client and would like them to see only the directories we allow.

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

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

发布评论

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

评论(6

哆啦不做梦 2024-07-27 13:48:16

在 Google 上搜索“openssh监狱”,我找到了openSSH的SSHjail。 如果您的客户端使用 ssh/scp 访问上述服务器,这可能就是您正在寻找的。

A Google search on "openssh jail" led me to SSHjail for openSSH. If your client uses ssh/scp to access the said servers, this might be what you are looking for.

锦爱 2024-07-27 13:48:16

2009 年的“最佳答案”已经过时了。
OpenSSH 现在附带了 ChrootDirectory 选项。
请参阅 http://www.debian-administration.org/articles/590 这是ssh 的旧版本。

The "best answer" from 2009 is outdated.
OpenSSH now comes with the ChrootDirectory option.
See http://www.debian-administration.org/articles/590 which is for an already-old version of ssh.

⊕婉儿 2024-07-27 13:48:16

需要注意的是,chroot(2) 并不是出于安全目的。 逃离 chroot 监狱非常容易。 有关详细信息,请参阅这篇关于滥用 chroot 的文章。

It is important to note that chroot(2) is not meant for security purposes. It is incredibly easy to escape a chroot jail. See this article on abusing chroot for more information.

机场等船 2024-07-27 13:48:16

如果你真的想达到这个极端,SE Linux(或任何其他强制访问控制)是对默认unix权限的明确改进。

If you really want to go to that extreme, SE Linux (or any other mandatory access control) is a definite improvement of the default unix permissions.

等待圉鍢 2024-07-27 13:48:16

一个有效的方法是使用 lshell

An effective way to do this is to use lshell

池予 2024-07-27 13:48:16

没有简单的方法可以将用户囚禁在他们的主目录中。
顺便说一句,我永远不会将我的系统的访问权限授予我至少不信任的人。

上次我这样做时,我使用了基于
http://bash.cyberciti.biz/guide/A_menu_box
.bashrc 启动这个你无法逃脱的脚本:

~/.bashrc :
(LAST LINE)
./menu.sh; exit 0

是的,我必须为每个菜单项编写脚本(获取日志,检查系统,...),但没有人运行 'chown -R root:root /' 而不是*。
无价。

[编辑]:创建一个专用用户,不要以 root 身份执行此操作!

No easy way to jail users in their homedirs.
BTW, I would NEVER give access to my systems to someone I don't trust a minimum.

Last time I did, I used an "unescapable" menu based on
http://bash.cyberciti.biz/guide/A_menu_box
The .bashrc launches this script you would not escape :

~/.bashrc :
(LAST LINE)
./menu.sh; exit 0

Yes, I had to write scripts for each and every menu item (get logs, check sys, ...) but nobody to run 'chown -R root:root /' instead of *.
Priceless.

[EDIT] : create a dedicated user, don't do this as root !!!

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