Ubuntu 服务器上的权限是如何继承的?

发布于 2024-07-05 14:14:00 字数 768 浏览 7 评论 0原文

很抱歉第二个新手问题,我是开发人员而不是系统管理员,所以这对我来说都是新的。 我希望我能清楚地解释自己! 开始。

这是我所做的:

  • 登录到根帐户

  • 创建帐户“richard”和“austin”< /p>

  • 创建组“developers”,并向其中添加“richard”和“austin”

  • 创建了目录/server,并使用“chown richard:developers /server”来更改所有者

  • 将/server的权限更改为drwxrwxr-x(以便组可以对其进行写入)

  • 注销 root 帐户,并进入“richard”帐户

  • 创建目录 /server/product 和 /server/staging

  • 在 /server 中使用“ls -l”列出内容,并找到 drwxr 的权限-xr-x 以及 /server/product 和 /server/staging 的“richard:richard”所有权。 因此,'austin' 可以在 /server 目录内进行编辑,但不能在 'richard' 创建的目录内进行编辑。

我究竟做错了什么? 我想确保 /server 目录中创建的任何文件或文件夹都具有组写入权限并且属于开发人员组。 我该怎么办?

谢谢你的帮助!

Sorry for the second newbie question, I'm a developer not a sysadmin so this is all quite new to me. I hope I can explain myself clearly! Here goes.

Here's what I did:

  • Logged into the root account

  • Created the accounts 'richard' and 'austin'

  • Created the group 'developers', and added 'richard' and 'austin' to it

  • Created the directory /server, and used "chown richard:developers /server" to change the owner

  • Changed the permissions of /server to drwxrwxr-x (so the group can write to it)

  • Logged out of the root account, and into the 'richard' account

  • Created the directories /server/production and /server/staging

  • Used "ls -l" inside /server to list the contents, and found permissions of drwxr-xr-x and ownership of "richard:richard" for both /server/production and /server/staging. Consequently, 'austin' can edit inside the /server directory, but not inside the directories 'richard' created.

What am I doing wrong? I want to ensure that any files or folders created inside the /server directory have group write permissions and belong to the developers group. How do I go about that?

Thanks for any help!

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

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

发布评论

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

评论(4

征﹌骨岁月お 2024-07-12 14:14:00

看起来您想使用“chmod g+s”或“chmode 2775”来获取目录上设置的 SetGID 位,如果我正确记得我的权限模式,那么应该保留该组。

Looks like you want to use "chmod g+s" or "chmode 2775" to get the SetGID bit set on the directory, that should preserve the group if I remember my permission modes properly.

楠木可依 2024-07-12 14:14:00

当您以 richard 身份创建目录时,系统假定您是所有者并将您设置为所有者,您可以手动更改所有权和权限

sudo chown richard:developers
sudo chmod 775


设置创建文件/文件夹的默认权限(发现:http://wiki.slicehost .com/doku.php?id=setting_up_ubuntu_slice_with_django_postgresql_ledgersmb_and_openvpn)

使用 acl(请参阅:http://ubuntuforums.org/showpost.php?p =3718480&postcount=12)了解详情

When you created the directories as richard the system assumed that you were the owner and set you as the owner, you can either change the ownership and permissions manualy

sudo chown richard:developers
sudo chmod 775

or
set the default permissions for creating files/folders (found this: http://wiki.slicehost.com/doku.php?id=setting_up_ubuntu_slice_with_django_postgresql_ledgersmb_and_openvpn)
or
use acl's (see: http://ubuntuforums.org/showpost.php?p=3718480&postcount=12) for details

伤感在游骋 2024-07-12 14:14:00

您必须设置限制性 umask

编辑 ~/.bash_profile

并修改特定用户的 umask 设置。

http://en.wikipedia.org/wiki/Umask

you must have set a restrictive umask

edit ~/.bash_profile

and modify the umask setting for the specific user.

http://en.wikipedia.org/wiki/Umask

不交电费瞎发啥光 2024-07-12 14:14:00

你是如何更改/server的权限的? 如果没有,请递归执行。

祝你好运!

How did you change the permissions of /server? Do it recursively, if you didn't.

Good luck!

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