• chmod 4755

    From Doug Laidlaw@2:250/1 to All on Mon Aug 26 12:24:05 2019
    In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
    denied," but the result was 755.

    Doug.
    --
    When his sweetheart said "Come on, let's settle down,"
    Wild Cat raised his head and cried:
    "Not bloody likely!" --Cole Porter/G.B. Shaw.

    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From Aragorn@2:250/1 to All on Mon Aug 26 13:10:37 2019
    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

    --
    With respect,
    = Aragorn =


    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Strider (2:250/1@fidonet)
  • From Jim Beard@2:250/1 to All on Mon Aug 26 13:22:30 2019
    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.

    --
    UNIX is not user-unfriendly, it merely expects users to be computer-
    friendly.

    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Doug Laidlaw@2:250/1 to All on Mon Aug 26 13:23:39 2019
    On 26/8/19 10:10 pm, Aragorn wrote:
    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

    Thanks, I just found a log line that says that. Apparently sudo does
    not give me high enough permissions.


    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From Doug Laidlaw@2:250/1 to All on Mon Aug 26 13:50:28 2019
    On 26/8/19 10:22 pm, Jim Beard wrote:
    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.


    Thanks for the explanation, Jim. I had heard of SUID, but had never encountered it before. In this case, a "sandbox" file needed it before
    it could be edited. I ran "su -" first, then the change was accepted.
    In Windows, of course, the problem didn't arise.


    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Aug 26 15:48:18 2019
    On 2019-08-26, Doug Laidlaw <laidlaws@hotkey.net.au> wrote:
    In "chmod 4755," what does the 4 do? Using sudo, I got "Permission
    denied," but the result was 755.

    man chmod
    explains all the bits.


    Doug.

    --- MBSE BBS v1.0.7.12 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)