There are a couple other flags you might see over time.  Capital T, which
means that the "other" (the last bit in chmod) did not have +x set.

You also have setuid and setgid.  Set uid (s) on a file will make it execute
with the permissions of the owner regardless of who is executing the
command.

ls /usr/bin/passwd -il
968048 -rwsr-xr-x 1 root root 29104 2008-11-13 01:51 /usr/bin/passwd

Because the x has been replaced by an s you know that this has setuid.  This
is because /etc/passwd can only be read by root or a super user, but users
need to be able to change their own passwords.  By executing passwd with
setuid in place it will appear to the rest of the system as if root had run
the command.  This can be accomplished by adding 4 to the front of chmod.
So if you wanted read and write for everyone but execute for owner and you
want setuid bit set.  'chmod 4766 filename' and setgid is 'chmod 2766
filename' and that does the same thing but based on groups.

Setuid and setgid on directories is a little different, it will inherit user
or group on new files.  So if you had a user/group that was peter/manis
normally when creating a file it would be peter as the user manis as the
group.  If a directory was listed as having an group owner of 'admin' and it
had the setgid bit set, the file would be created with permissions as
owner=peter group=admin.

Btw, sticky bit can be set with chmod, 'chmod 1766 filename'.  If you don't
want to bother with the numbers and chmod for these you can do the following

setuid = chmod u+s filename
setgid = chmod g+s filename
sticky = chmod +t filename

On Sun, Nov 23, 2008 at 4:06 AM, Manny <[email protected]> wrote:

> Thanks!
>
> Even old dogs can learn new tricks! ;-)
>
> --Manny
> On Sun, Nov 23, 2008 at 12:27 AM, Peter Manis <[email protected]> wrote:
> > t represents a sticky bit.  Linux ignores the sticky bit on files, but it
> > does take into account the sticky bit on directories.  When a directory
> has
> > the sticky bit it prevents users from renaming, deleting, or moving files
> > that are not owned by the user they are logged in as.  Only the owner of
> the
> > directory can perform those actions even if the user has write
> permission,
> > unless it is a super user.
> >
> >
> > On Sun, Nov 23, 2008 at 2:46 AM, Manny <[email protected]> wrote:
> >>
> >> Does anyone know what the "t" in the world permissions field means?
> >>
> >> drwxr-xr-t 13 vectormax vectormax   4096 2008-11-20 23:48
> >> eschalon_b1_saved_game
> >>
> >> It's a game save file. I've never heard of or seen a "t" in the
> >> permissions field.
> >>
> >> d - directory  (also "l" for symbolic link)
> >> r - read
> >> w - write
> >> x - execute
> >> t - ?
> >>
> >> I guess there's a first time for everything.
> >>
> >> --Manny
> >> _______________________________________________
> >> LinuxUsers mailing list
> >> [email protected]
> >> http://socallinux.org/cgi-bin/mailman/listinfo/linuxusers
> >
> >
> >
> > --
> > Peter Manis
> > (678) 269-7979
> >
> > _______________________________________________
> > LinuxUsers mailing list
> > [email protected]
> > http://socallinux.org/cgi-bin/mailman/listinfo/linuxusers
> >
> >
> _______________________________________________
> LinuxUsers mailing list
> [email protected]
> http://socallinux.org/cgi-bin/mailman/listinfo/linuxusers
>



-- 
Peter Manis
(678) 269-7979

Reply via email to