difference between chmod 777 and chmod 007

8

2

What is the difference between chmod 777 and chmod 007? if 'others' means everyone, doesn't that strongly suggest the truth that chmod 777 = chmod 007?

adhg

Posted 2013-02-07T04:03:28.987

Reputation: 185

Answers

11

It may suggest that, but it isn't the case.

The first digit is "owner" permissions, the second is "group" permissions - and the owner and group are viewable with ls -l, and the third is "others", which literally means those that aren't either the owner or in the group.

So 007 means that neither the owner or group members can read, write, or execute the file, while everyone else can do all three.

Paul

Posted 2013-02-07T04:03:28.987

Reputation: 52 173

can you provide a real life example where this scenario exists (007)? Thanks – adhg – 2013-02-07T23:53:14.070

1@adhg No :) I cannot think of a specific scenario that would need this, that couldn't be acheived through better means. – Paul – 2013-02-08T00:26:15.160

4

No. 0007 explicitly denies access by the owner and group, regardless of the other permissions.

Ignacio Vazquez-Abrams

Posted 2013-02-07T04:03:28.987

Reputation: 100 516

1I think you meant 007 – Jay – 2013-02-07T04:08:09.503

4@Jay: They're exactly the same. – Ignacio Vazquez-Abrams – 2013-02-07T04:08:34.023

2

If 'others' means everyone, then yes. However it does not mean that.

Very briefly it is: User, group, people_not_previous_group

Hennes

Posted 2013-02-07T04:03:28.987

Reputation: 60 739