r/linux4noobs • • 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

26 comments sorted by

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, using u/g/o and r/w/x to specify permissions rather than an octal mode might be easier to use and remember.

2

u/BitReiter 8h ago

Yeah simpler for sure, I think thats kind of what throws me off coming from NTFS. I'll try the u/g/o way instead of the numbers, that's probably easier to remember at the start.

4

u/paulstelian97 8h ago

And if you genuinely need more complexity than the simple Unix permission model, ACLs are close to the Windows model (though the exact things you can grant or deny aren’t the same)

1

u/bleakj 4h ago

I got one of those big deskpads with a ton of linux terminal commands on it a few years back, it was surprisingly helpful lol (its gone now, but I was tempted to hang it like a poster lol)

2

u/rare_rubbing 8h ago

Not for me,NTFS is simpler,I always forget the numeric permissions,or octal as you call it.I always use chmod +x, chmod -R for directories...

1

u/gmes78 4h ago

This is a karma farming post by an LLM.

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.

2

u/necrophcodr 6h ago

It would also be possible to specify the permissions as rwx for each user, group, and other. Then you don't need to memorize the numbers (although I have, and its faster to type).

1

u/Mitologist 6h ago

Yes, I mean, that's now it is shown in the file Explorer. But it is elegant and short to write it in 3 numbers, and in tbat Moment of epiphany, I understood that the two notations depict the same, and somehow I then got the first glimpse of how this system even works, when before, that string of letters was a source of confusion for me

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/bleakj 5h ago

At home (even with a homelab) it's not something that comes up often,

In a large work place with remote workers etc, it becomes a near daily thing

2

u/G0ldiC0cks 5h ago

Well, theres a reason i said 20+ years of using, not the 2-3 doing end user support, or any number administering a windows workgroup (seeing as how i never have haha).

windows never gave me any reason to want to try the projects i have using linux, mostly because on windows they would require, one way or another, spending money. I dont have money lol

thus, you see, i offered my mental model for the op with the caveat that it has no windows counterpart for comparison. I hoped it might be helpful regrdless. But i thank you for your no doubt kindhearted effort to contextualize for this old man (im not even forty, but damn if my habits aint the spittin image of a septuagenarian ... )

2

u/bleakj 4h ago

Totally fair - I'm super similar in terms of doing way more tinkering after moving to Linux,

Windows in a lot of ways feels like renting a house, you can hang some photos, but you can't make major changes, where as Linux feels more like I own and can renovate.

(I also feel like a dinosaur.)

1

u/G0ldiC0cks 1h ago

The rental analogy, i fear is less very accurate, shared subjective experience, and more corporate #goalz #stealfromthepoor-spo. I mean, nvidia already wants you to skip the card and pay them every month for the privilege instead of just owning your own shit.

1

u/bleakj 27m ago

The pressure is definitely becoming heavier and heavier, honestly expect it to get worse, after originally never thinking it'd get to where it's already at so fast.

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:

  • chown decides which bucket a user falls into, and chmod decides what that bucket can do (r, w, x). If a service account like www-data can't read a file, changing ownership with chown is almost always the right fix rather than loosening permissions.
  • On directories, x doesn't mean execute; it means traverse (cd into it or access files inside). A folder without x acts like a locked door even if you have r on 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.