Vdubjunkie Posted November 20, 2003 Report Share Posted November 20, 2003 Hello all, I have seen many times people explaining chmod using letters such as u+x or something of that nature, and since numbers just make sense to me rather than learning more obscure letters and what they pertain to, I opted for numbers. However, when having to do a chmod u+s on my /usr/bin/smbmnt file to "install" it "suid root" I wondered what if any equivalent in numbers there would be. If there isn't I guess I may have to learn the letters. Man that will piss me off Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted November 20, 2003 Report Share Posted November 20, 2003 For set uid do: # chmod 4755 <path to exectuable> The "4" flag in front of the usual numbers sets the set uid permission. Quote Link to comment Share on other sites More sharing options...
spinynorman Posted November 20, 2003 Report Share Posted November 20, 2003 You may find this useful: Fun with Numbers in chmod. B) Quote Link to comment Share on other sites More sharing options...
Vdubjunkie Posted November 21, 2003 Author Report Share Posted November 21, 2003 Thanks guys. Unfortunately the link only provided me with all the chmod info I already know and use regularly. I'll keep looking around to find something that explains that first of 4 number strings when doing a "number" chmod. :P Quote Link to comment Share on other sites More sharing options...
Qchem Posted November 21, 2003 Report Share Posted November 21, 2003 You'll find that information in man chmod :D Quote Link to comment Share on other sites More sharing options...
spinynorman Posted November 21, 2003 Report Share Posted November 21, 2003 I'll keep looking around to find something that explains that first of 4 number strings when doing a "number" chmod. Sorry, didn't read your post properly. According to a Linux Journal article on the subject - In octal mode, SUID and SGID are set by specifying them in another column before the user mode. For SUID use 4, for SGID use 2, and use 6 for both: $ chmod 4755 test_file -rwsr-xr-x 1 eric users Is this what you're looking for? :unsure: Quote Link to comment Share on other sites More sharing options...
Qchem Posted November 21, 2003 Report Share Posted November 21, 2003 Quoting man chmod: The first digit selects the set user ID (4) and set group ID (2) and sticky (1) attributes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.