TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How do groups work on Linux?

239 pointsby deafcalculusover 7 years ago

8 comments

ScottBursonover 7 years ago
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 未加载
mason55over 7 years ago
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 未加载
chairmanwowover 7 years ago
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 未加载
Asookaover 7 years ago
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_over 7 years ago
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 未加载
halayliover 7 years ago
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 未加载
3apover 7 years ago
Also &quot;newgrp&quot; can be used for join &quot;new&quot; groups without re-login.
评论 #15748022 未加载
yubioxover 7 years ago
&quot;dr--r--r-- 1 bork awesome 6872 Sep 24 11:09 file.txt&quot;<p>This doesn&#x27;t make sense.
评论 #15749757 未加载
评论 #15749254 未加载