account permissions.

Geoff Shang gshang at uq.net.au
Wed Apr 25 02:13:01 EDT 2001


On Sun, 22 Apr 2001, Gregory Nowak wrote:

> I thought you could use letters as well with chmod where - means no
> permision, and + before the letter means permision.

You can.  To do this, you need to specify permissions like so:

chmod <entity><operator><permission> file

Where:
  Entity can be U for user, G for group, O for other, or A for all
  Operator can be plus, minus or equals
  Permission can be R W X or S

I like this way of doing things, as you can pretty easily tell what you're
doing.

You can specify more than one of these by placing a comma between them.
For example:

chmod u=rwx,go=rx /usr/bin/lame

or the same command written another way:

chmod a=rx,u+w /usr/bin/lame

You will also see there that you can use any number of either of the
fields.

Note also that multiple commands are enacted sequentially.  For example,
you could give read and write permission to only the user by doing:

chmod a-rwx,u=rw .fetchmailrc

Though of course, 'chmod go-rwx,u=rw' or even 'chmod go=,u=rw' would work
just as well.

The S is the sticky bit.  For user it says that the file should
be assumed to be accessed by the current user, not by the actual user.  For
example, if I have a program that I, as root, do a "chmod u+s" on, that
program will look like it's being run by root, rather than the user that is
actually running it.  Needless to say, this is not something one does
lightly.  I'm not sure of what the sticky bit does for the other 2 fields,
consult the chmod manpage for more on this.

Geoff.






More information about the Speakup mailing list