FreeBsd:允许同一组的用户对其创建的文件和目录具有自动读/写访问权限

发布于 2024-08-02 02:17:57 字数 262 浏览 2 评论 0原文

在我们的 FreeBSD 环境中,我们有一台服务器充当文件服务器,但我们遇到了系统管理员说无法修复的问题。

我们所有的文件都驻留在一个目录中,并且我们都可以访问该目录及其子目录和文件。 问题是,一旦我们组中的用户创建了文件或目录,我们就必须 chmod 该目录或文件来更改权限,以便我们组中的其他人可以访问、读取、写入和删除。 这些不是我们的主目录中的文件或子目录,而是在我们每天应该使用它们的目录中。

很难相信没有好的解决方案,我会请求有人帮助我找到解决方案。

In our FreeBSD-environment where we have one server that acts as a file-server, we have a problem that our system administrator says can not be fixed.

All our files resides in a directory and we all have access to that directory, its sub-directories and files. The problem is that once a user in our group creates a file or directory, we have to chmod that directory or file to change the rights so that others in our group can access, read, write and delete. These are not files or sub-directories inside our home-directories, but in a directory where we are supposed to work with them on a daily basis.

Finding it difficult to believe that there is no good solution, I would request that someone assist me with a solution.

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

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

发布评论

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

评论(2

烟燃烟灭 2024-08-09 02:17:57

我认为你想要的是目录和 umask 上的 setgid 位。 然后新创建的文件和目录将具有适当的组和适当的权限,以让其他人读取和写入它们。

在此处查找 /your-files-are-rooted-here -type d -print0 | xargs -0 chmod ug+rw,g+s

并将 umask 设置为 002 (或任何合适的值)。 当然,您可能想修复现有文件的权限(上面的命令仅处理目录)。

I think what you want is a setgid bit on the directories and umask. Then newly created there files and directories will have proper group and proper permissions to let others read abd write them.

find /your-files-are-rooted-here -type d -print0 | xargs -0 chmod ug+rw,g+s

and set umask to 002 (or whatever is appropriate). And, of course, you may want to fix permissions for existing files (the command above only takes care of directories).

零崎曲识 2024-08-09 02:17:57

umask 设置的一个地方是“/etc/bashrc”。 找到“umask”。 将“umask = 022”更改为“umask = 002”。 完成此操作后,当创建一个新文件时,与该文件所有者位于同一组中的每个人都可以在该新文件中写入。

请注意,这仅适用于从 shell 创建的文件,特别是 bash。

One place to but the umask setting is "/etc/bashrc". Find "umask". Change "umask = 022" to "umask = 002". After doing this, when a new file created, every one in the same group with the file owner can write in this new file.

Note that this only works for files created from the shell, specifically bash.

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