File permissions, or modes, are set with the chmod program.
All users are allowed to set the read/write/execute permissions for user/group/other on all files that they own. Only the superuser (root) can set the modes on anybodies files, or set the SetUserID, SetGroupID or Sticky permissions.
As outlined above, the octal permissions are: read (4), write (2) and execute (1). Chmod can also work with symbolic permissions.
Who:
What:
chmod a=rw file chmod 666 file chmod u=rwx,go=r file chmod 744 fileThe first pair of examples are equivalent, as are the second pair of examples. Chmod has a few options, but perhaps the most useful one is the ``-R'' or ``-recursive'' switch, which makes newer versions of chmod ``walk'' the directory structure altering all subdirectories which fit the pattern specified in the ``file'' argument.