TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How do groups work on Linux?

239 点作者 deafcalculus超过 7 年前

8 条评论

ScottBurson超过 7 年前
One of the most useful group-related tricks (introduced in BSD Unix, I believe) is the setgid bit on a directory. If this is set, new files and subdirectories created within the directory will have the same group as the directory, rather than the group of the process that created them.
评论 #15747249 未加载
评论 #15747286 未加载
mason55超过 7 年前
The book she mentions, "The Linux Programming Interface," sounds pretty useful, but it's seven years old at this point. Does anyone know how much has changed or if there's a new version coming any time soon? Seems like it's worth $70 but the age has me concerned. I'm sure the basics, like the things this article is about, haven't changed, but I bet all the stuff around cgroups would be useful for how setgid works with a process.
评论 #15748461 未加载
评论 #15750226 未加载
评论 #15749894 未加载
chairmanwow超过 7 年前
I absolutely love Julia Evan's writing. I find her articles / zines to cover interesting and useful technical topics while remaining _extremely_ accessible to me (especially when I was a student)! I really admire her ability to present technical topics in plain language.
评论 #15748051 未加载
Asooka超过 7 年前
Ohh, so THAT's why I have to log out and back in to have my group changes take effect. That, along with having to start a new shell to pick up new env vars from ~/.profile, are my two biggest annoyances with the Linux process model. Reminds me a bit of the Windows 98 days when you had to restart to change your IP address. I really wish someone would sit down and figure out how to propagate group and environment changes to already running processes and implement them.
评论 #15747970 未加载
评论 #15749469 未加载
评论 #15748547 未加载
评论 #15747677 未加载
tiben_超过 7 年前
Some highlighted words do not appear using Firefox 57 on my Ubuntu 16.04.3, like the word &quot;julia&quot; at the third line. It&#x27;s OK with Chromium.<p>EDIT: Seems a Firefox related bug, i noticed this strange behavior with other websites inc. Stack Overflow since then. Will investigate asap.
评论 #15750841 未加载
halayli超过 7 年前
Regarding setuid, this is why when you run programs like ping(8) it doesn&#x27;t require root access to open a raw socket. ping&#x27;s setuid is set so upon execution it executes as root since ping is owned by root and then calls setuid(getuid()) to run as the intended user.
评论 #15750685 未加载
3ap超过 7 年前
Also &quot;newgrp&quot; can be used for join &quot;new&quot; groups without re-login.
评论 #15748022 未加载
yubiox超过 7 年前
&quot;dr--r--r-- 1 bork awesome 6872 Sep 24 11:09 file.txt&quot;<p>This doesn&#x27;t make sense.
评论 #15749757 未加载
评论 #15749254 未加载