[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: you need to explain my rights to me



On Wed, Sep 26, 2001 at 07:41:24AM -0700, Robert Threet wrote:
> *sigh*  This is embarrassing.  I should know this.  I'm
> having trouble getting WinSCP to work with most of my
> users.  The special users I have created all work but the
> older users are under a directory who's rights are:
> 
> 256 drwxr-sr-x14324 root     staff     259584 Sep 25 15:35
> user
> 
> Q: What's the 256?  I'm guessing the 14324 is the number of
> directories underneath.  My bigger question is "What is
> that 's' doing there and why can't I get rid of it?".

'ls -idl user'
would generate output like that.  If that's what you ran, then
the "256" is the inode number of the directory, the "14324" is
the number of child directories (including "." and "..").  The
drwxr-sr-x is the mode of the entry.  The "d" signifies that
it's a directory, and the remaining 9 bits show the permissions.
The first three (counting from the left) are the user's permissions,
the next three are the group permissions, and the last 3 are the
"others" permissions.  They'll always be in order read, write,
execute, with an "r/w/x" showing up if the permission is granted,
and a "-" showing up if not.

There are only 9 places available for display.  That creates a
problem, since chmod uses 12 "positions".  If the suid, sgid, or
sticky bits are set on a file, they're represented by ls as an "s"
in the normal execute bit's place of the user, group, and other
columns, respectively. The "s" will be lowercase if the execute
bit is set, or uppercase if the execute bit is not set.  The "r-s"
in the group column, therefore, means that the sgid bit has been set
on that directory and that it's group readable and executable. For
a directory, the sgid bit means that directorys created inside will
inherit their parent's group id.

To get rid of it, either do
	'chmod g-s user'
or
	'chmod 0755 user'
though it might make sense to leave it there, as that's (most likely)
not causing your problems.

Sorry that took so long.  Sometimes I ramble. :)

--Danny
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.