[linux-help] Re: CGI-Script
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Koji Hayakawa wrote:
>
> On the other LUG list (Tokyo LUG), they were just talking about chmod 1755.
> Now I see chmod 4755. What other options are there as 1st of 4 digit set
> used in chmod? I'm only familiar with last 3 digits on this.
>
> Just a curiosity question...
4000 is the "setuid" bit. if you set this on an executable file, when the
program is run it will assume the effective user id of the owner of
the file. this is usually done for a program that has to have root
(superuser) permissions, but can be run by anyone. an example is
/usr/bin/passwd, which has to be able to rewrite the /etc/shadow
file when you change your password.
2000 is the "setgid" bit. this works the same way, except sets the effective
group id to the group owner of the file. this might be used for a
program where many users need to write to the same directory, but
do not need superuser permissions.
1000 is the "sticky" bit. this used to be a minor performance optimization,
but nowadays is mostly used for directories like /tmp, where it allows
anyone to create a new file, but only allows file owners to delete
their own files.
These values are all octal numbers, representing single bits in the st_mode
word of the file's struct stat. The chmod(1) program will let you set these
with the octal values, or with symbolic values; see the man page.
--
/*
* Tom Hull * thull at kscable.com * http://www.tomhull.com/
*/
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi
|
|