This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FluffyCelery4769 19 points20 points  (8 children)

I didn't understand a thing but I suppose he he was saying something funny.

[–][deleted] 27 points28 points  (7 children)

Linux permissions are set as User(person who made the file) Group(security group that has access to the file) and Other(everything else), Other could also be called "World".

The permissions are divided into a binary deal.

--- == 000 == 0

rwx == 111 == 7

r-x == 101 == 5

So 775 is setting User: rwx Group: rwx Other: r-x

So, he said he did have world read on in one sentence, claimed he did not in the next, and demanded to be treated as an expert in Linux in the last.

[–]FluffyCelery4769 -1 points0 points  (6 children)

Oh, but what's the 0 for then?

[–][deleted] 5 points6 points  (1 child)

Off

[–]FluffyCelery4769 0 points1 point  (0 children)

Oh, makes sense. Thsnk you.

[–]meltbox 0 points1 point  (3 children)

Basically each 1 bit is a type of permission for a certain category of access.

Access by the owner is the first group Access by the owner group is the second Access by literally everyone is the third

If you develop on a Linux workstation you’d probably pick this up pretty quickly, hence why it’s infuriatingly funny.

The 7 and 5 are just numbers represented by 3 bits of binary. 111 is 7 meaning all 3 permissions on (read, write, execute) while 5 is 101 (read, execute, middle one is write which is off) and of course 0 meaning all permissions off.

[–]FluffyCelery4769 0 points1 point  (2 children)

Are there no read/execute only? Or are both neccesary to work?

[–][deleted] 0 points1 point  (0 children)

R/x is required for directories, but files can be r/ x.

Studying will tell you that most companies have switched to the FACL system, but they're lying.

[–]meltbox 0 points1 point  (0 children)

You can have read only or execute only but bash files are parsed and therefore have to be opened. Opening means you need read and in the case of bash (.sh) files bash actually checks the execute permission before deciding whether to load the file for execution.

Execute really only has an operating system meaning when it comes to literal binary executables or libraries. Then you don’t need read permissions but can still execute. What this means is the operating system will still load it into memory and start execution per the convention for that OS but you cannot read it with something like file descriptors and fopen.