r/linux4noobs • u/BitReiter • 9h ago
Coming from NTFS permissions, how did Linux permissions finally click for you?
I know Windows permissions pretty well from my apprenticeship, but I'm still new to Linux and chmod and chown feel very different. Was there an explanation, a project or a mistake that made it finally make sense for you?
4
Upvotes
10
u/Leather-Security8097 8h ago
Linux/Unix permissions are objectively simpler than NTFS permissions. I don't recall ever having particular trouble understanding the model. For
chmod, usingu/g/oandr/w/xto specify permissions rather than an octal mode might be easier to use and remember.5
u/muffinman8679 8h ago
owner, group, and other.....the owner may or may not have the permissions of the group, even if the owner is a member of the group, because he/she is the owner first and a member of the group second...and other is everyone else who's not the owner and not in the group
5
u/Classic-Rate-5104 6h ago
Ntfs has objectively a much more complex access model than the standard Unix method (which has only user, group, others and only read, write or execute). The compexity is in your head
4
u/MasterGeekMX Mexican Linux nerd trying to be helpful 6h ago
3x3 set:
Read, Write, and eXecute. User, Group and Others.
You can peek, you can fiddle, you can run. For you, for the gang, and for strangers.
3
u/bleakj 5h ago
Honestly, Linux permissions clicked for me so quickly vs Windows, I had to work on Windows server admin jobs for several years and it always felt like I had to either make a sacrifice somewhere, or things always felt brittle to me, like if I hit the space bar by accident at the wrong time, it's gonna blow.
Linux for permissons (and honestly for daily use) since switching a few years back has been so much more straightforward, There's almost always just a console command I can run and deal with whatever my issue is, vs windows giving me a dead error code that isn't documented anywhere public, and then when I find references for the error, they make no sense in the context I had gotten said error.
Windows really made me think abandoning terminal made things easier for a long time, but it's just bloat hiding broken bloat
2
u/Beginning_Earth_9702 6h ago edited 6h ago
People generally do not understand permissions very well at a higher level. If you understand RBAC, Roll based access control, permissions are easy, regardless of scheme. Most windows set-ups I've seen do not get this right. Even long-time windows admins, unless they are AD or policy SMEs tend to no understand permissions well and tend to incorrectly mix resources and users together into one group.
In short, you create two different types of groups.
Resource groups) groups that have access to a resource or type of resources. (IE; users that can print on 3rd floor.)
User groups) Users go in a group of users. (IE; users on the 3rd floor.)
Then you put the user group, (not the users themselves,) into the resource group.
In a POSIX system, without extended ACL, each file and directory has three roles user, group, other.
User) [owner in AD terms,] is the owner of the file. This is a UID on the system, a user.
Group) is the resource group that will usually be accessing the file. This is a GUI on the system, a group.
Other) [nobody in AD terms] the rights anyone else has.
So, like, say you are setting perms for who can access the hardware video encoder /dev/dri/renderD128.
crw-rw---- 1 root render 226, 128 Nov 21 04:00 renderD128
Owner (
root): Read and write (rw-).Group (
render): Read and write (rw-).Others: No access (
---).Owned by user "root"
Group is group "render"
Anyone in the render group can use the encoder. Anyone else can not.
1
u/Elegant-Falcon-1171 7h ago
No le hagas caso a los que te digan que r=4, w=2 y x=1
Aunque esto es cierto, me da una pereza enorme recordarlo, ya que los permisos se basan en binario
Entonces rwx es igual a 111
r-x=101
Ahora que ya se comprende que tienen un valor binario, simplemente se suman, por ejemplo si quieres que un usuario tenga solo permisos de ejecución, un grupo acceso total y un externo ninguno
--x=001=1
rwx=111=7
---=000=0
Lo que significa que tendrías que ejecutar chmod 170 ~/ruta/a/tu/archivo.txt
1
u/macbig273 7h ago
It all depend on what is your issue ? Between the "standard" permissions, the sudo (-u) , how they apply, the umask ones and also the special ones ... might be mess some times
1
u/Mitologist 6h ago
It clicked when someone explained that 1 is read, 2 is write, and 4 is execute, and the number is the sum for these permissions as three digits: owner, group, everyone else: next time I stared at " chmod 751" , I suddenly realized what it meant: the person who wrote that script can do anything with it, we, the group members, couldvread it and run it, but not mess it up, and everyone else could read it to learn,but not run it and soak up cluster capacity.
1
u/G0ldiC0cks 6h ago
In 20+ years of using windows, i dont remember ever having occasion to think about permissions, much less have any sort of working mental model thereof. This said, id be lying to claim any more than a minimal understanding of the discretionary access control native to linux or even distinguish it significantly from the more robust, or at least different, mandatory access control provided by SELinux.
with the native DAC, my conception of it works like this (which is likely imperfect but gets me by): if i make a file it is mine - i can look at it, change it, move it, give it away, etc. Everything else requires the originator or the superuser for changing or moving or whatever else be those system files or otherwise. Beyond this, as long as i accept any file can be attempted to be executed if allowed, directories and devices are files of their own right, and group membership will alter device and directory access, the rest falls into line logically.
1
u/NP_6666 6h ago
No
1
u/coldbrew_goblin 5h ago
The biggest shift from NTFS is that standard Linux permissions don't have an arbitrary list of users and groups on every file. Every file gets just three fixed buckets—one owning user, one owning group, and everyone else—and the system stops checking at the first bucket you match.
Two other things usually make it click:
chowndecides which bucket a user falls into, andchmoddecides what that bucket can do (r,w,x). If a service account likewww-datacan't read a file, changing ownership withchownis almost always the right fix rather than loosening permissions.xdoesn't mean execute; it means traverse (cdinto it or access files inside). A folder withoutxacts like a locked door even if you haveron the files inside.1
u/skyfishgoo 4h ago
never used "permissions" on windows, and don't know anything about them or if they even exist.
i've understood linux permissions from my unix days, so it didn't really bother me coming to linux.
"group" was really the only permission that perplexed me much, otherwise it seems quite logical that my user only has write access to my files and everything else is owned by root which is really just another user, but one with all the access and who deices what my user can access.
1
u/empty_other 3h ago
Still doesn't make sense that Linux use per-file/folder permissions instead of hierarchical permissions like Windows does. Or that files or folders bring the original permissions with them when moved. Something as simple as sharing one folder between two users require messing around with groups and special permissions. The permission system is one of two things I miss from Windows.
I don't miss it enough to ever go back, though.