[plug] file permissions

Anthony J. Breeds-Taurima tony at cantech.net.au
Tue May 7 12:29:16 WST 2002


On Tue, 7 May 2002, James Elliott wrote:

> File permissions are typically read, write, and execute (rwx), but
> sometimes you see and "S" or  "t" when you do and ls -l ... what do these
> mean, please, and are there any other permissions?

an ls -l will show you 10 possible permissions fields 
ie
?rwxrw---x
The first field is usually a '-' BUT you will see it as 'd' for directories
and 'l' for soft links.

Owner permissions
'r' File is readable by owner
'w' File is writable by owner
'x' File is executable by owner
's' Means it has the execute bit AND the setUID bit set.
'S' Means it doesn't have the execute bit BUT the setUID bit is set.

Group Permissions
'r' File is readable by group
'w' File is writable by group
'x' File is executable by group
's' Means it has the execute bit AND the setGID bit set.
'S' Means it doesn't have the execute bit BUT the setUID bit is set.

Group Permissions
'r' File is readable by everyone NOT covered by owner or group
'w' File is writable by everyone NOT covered by owner or group
'x' File is executable by everyone NOT covered by owner or group
't' Means it has the execute bit AND the sticky bit set.
'T' Means it doesn't have the execute bit BUT the sticky bit is set.
 
setUID means that the file (executable) will run as the actual owner NOT
the user running the command.  This is used in apps like:
/bin/su
/bin/ping
/bin/mount
/bin/umount

setGID has a similar meaning to setUID but as you'd prolly expect it affect
the groupID not the userID on a Redhat 6.2 system /sbin/netreport has setgid
set.

The sticky bit is somewhat unused now days.  It basically meant leave this
executable in memory even when it isn't running.  It was used for apps that
were frequently run as a way to boost performance.

Each of the setuid, setgid and sticky bits have slightly different meanings
on directories, but you asked about files :)

Yours Tony.

/*
 * "The significant problems we face cannot be solved at the 
 * same level of thinking we were at when we created them."
 * --Albert Einstein
 */



More information about the plug mailing list