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

Re: yee-gads! i almost had it.



Check out the "umask" command ;-)

On Thu, 2005-02-24 at 07:30 -0600, Kyle Pointer wrote:
> Why doesn't someone just ssh into the box already. This is getting far
> more confusing than it should be. Not that any information given has
> been useless or anything but *I* would find a bunch of binary kinda
> intimidating... and I code! I'm not suggesting I do it, because I don't
> know crap about permissions but for the love of octagons... Its a flash
> drive.. :| It shouldn't be this hard. :(
> 	--kyle
> 
> On Wed, 2005-02-23 at 20:52 -0600, Nathaniel Reindl wrote:
> > On Wed, Feb 23, 2005 at 03:07:04PM -0600, bntly.rhds wrote:
> > > apparently if i want -rwxrw-r-- then i need to put 764 minus 666 which 
> > > gives me 098.  i don't know, but does that sound right?  umask=098 (aka 
> > > 764)? 
> > 
> > You take the complement of the mode you'd set with chmod.  This isn't
> > straight-up arthmetic, either; these are logical operations.
> > 
> > In binary:
> > 
> > 000 111 110 100 (in octal, 0764, set with chmod)
> > 111 000 001 011 (in octal, 7013, set with umask)
> > 
> > You should notice a pattern here. :)
> > 
> > FWIW, the modes work like this (with comedy ASCII art option):
> > 
> >   ___ ___ ___ 
> >  /2^2/2^1/2^0/'
> > ------------- | 
> > | r | w | x | '
> > -------------/
> > 
> > 2^2, if high, sets the permission bit for reading.
> > 2^1, if high, sets the permission bit for writing.
> > 2^0, if high, sets the permission bit for executing.
> > 
> > Now, there are four groups (the special group isn't really included
> > here, and it's often omitted since there aren't usually special octal
> > modes you'd set on files) that comprise a full permission setting.  As
> > mentioned already, the group furthest to the left is the special
> > group.  The three following that, respectively, are the owner, group,
> > and world groups.
> > 
> > So, the permission set above (0764) would mean that there would be no
> > special bits set, the file would be writeable, readable, and
> > executable by the owner, the file would be writeable and readable by
> > the owning group, and the file would be readable by the world.
> > 
> > Now, in case anyone is absolutely curious, this isn't the only time
> > masks like these are used.  Think about your IP address and subnet
> > mask and the relationship between them.  Try ANDing and ORing them. :)
> > 
> 
> -
> To unsubscribe, send email to majordomo@silug.org with
> "unsubscribe silug-discuss" in the body.
> 
-- 


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