In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
denied," but the result was 755.
In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
denied," but the result was 755.
On 26.08.2019 at 21:24, Doug Laidlaw scribbled:
In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
denied," but the result was 755.
It sets the SUID bit. See...
$ man 2 chmod
On Mon, 26 Aug 2019 21:24:05 +1000, Doug Laidlaw wrote:
In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
denied," but the result was 755.
The 4 of 4755 specifies "Set user ID"
To quote from man chmod, 6th paragraph under DESCRIPTION:
"A numeric mode is from one to four octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. Omitted digits are assume to
be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and restricted deletion or sticky (1) attributes. The
second digit selects permissions for the user who owns the file: read
(4), write (2), and execute (1); the third selects permissions for
other users in the file's group, with the same values; and the fourth
for other users not in the file's group, with the same values."
Cheers!
jim b.
In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
denied," but the result was 755.
Doug.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 482 |
Nodes: | 16 (2 / 14) |
Uptime: | 63:52:26 |
Calls: | 9,569 |
Files: | 13,663 |
Messages: | 6,143,737 |