On Thursday 24 May 2007 02:31, Michael S. Dunsavage wrote:
> How could I give a person read only rights to a file or directory?
>
> Say someone has to see information for accounting reasons of a project but
> doesn't need to change any data..
        This is a common unix | Linux scenario.  And with Linux there are many 
many 
possible answers to this question depending on whether you want to authorize 
groups or individuals, and whether you would like to use the added 
functionality of Access Control Lists.

        Let's say I want to make one of my directories read-only for everybody 
in my 
"users" group, but inaccessible to everyone else--- and only I can write to 
the directory:

        mkdir  MyNewDir

        chmod 0750 MyNewDir

        Now I'm going to create a file in the directory that is read only for 
everyone:

        cd MyNewDir

        touch MyNewFile

        chmod 0644 MyNewFile

The digits 0644 are octal numbers that break out into three bits each, each 
bit representing (r)ead (w)rite (e)xecute
        0       sticky  (don't worry about it just now)
        6       110             r w -           (owner me)
        4       100             r - -           (users)
        4       100             r - -           (others)

Directories must have execute permission set on in order to be accessed. 
"Others" will not be able to access MyNewDir, even though they have read 
authority to MyNewFile... because others do not have execute permissions on 
the directory. "Users may access the directory, and they may read MyNewFile, 
but they may NOT change MyNewFile... they do not have write authority to the 
file.

Permission bits are very basic to all unix installations... including Linux. 
You will find much detailed info on-line, and in the opensuse docs, that 
describe the file system, permissions bits, chmod command (also chown, chgrp) 
as well as the newer ACL access control lists.  

There are several ways to issue the chmod command... and there is a symbolic 
way to set the bits besides being good with octal.

Hope this gets you started... as you get comfortable... ask a specific 
question and we'll help you with a more specific answer... this answer is 
fairly short... but whole books have been written on the subject.




        
-- 
Kind regards,

M Harris     <><
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to