LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Folder and file permission (http://www.linuxquestions.org/questions/linux-newbie-8/folder-and-file-permission-738869/)

zion_rulz 07-09-2009 07:52 AM

Folder and file permission
 
I have a folder 'wscale' with 777 permission.

[root@TPL0635 out]# ls -lrt
total 1688
drwxrwxrwx 2 tux tplinux 4096 Jul 9 00:53 agrdata
drwxrwxrwx 2 tux tplinux 4096 Jul 9 17:08 wscale

Now, I want to create a user to give read only permission to this folder. How can I do this? Any help will be much appreciated.

Thanks.

kirukan 07-09-2009 08:07 AM

Quote:

drwxrwxrwx 2 tux tplinux 4096 Jul 9 17:08 wscale
The last rwx means you have allowed to all read, write and execute permissions.

abi0909 07-09-2009 09:06 AM

drwxrwxrwx : Let me split what each part means --

d: Its a directory
rwx: Read Write Execute for User/Owner
rwx: Read Write Execute for Group
rwx: Read Write Execute for others (not the owner of the file and the users in the group, but anybody apart from this)

So if the user you are going to add is not in that group, change the permission of the file to 774. This would change the directory permission from drwxrwxrwx to drwxrwxr-- . But this would apply ONLY for the directory, so you might have to do this for all individual files in the directory.

vonbiber 07-09-2009 09:23 AM

Quote:

Originally Posted by zion_rulz (Post 3602089)
I have a folder 'wscale' with 777 permission.

[root@TPL0635 out]# ls -lrt
total 1688
drwxrwxrwx 2 tux tplinux 4096 Jul 9 00:53 agrdata
drwxrwxrwx 2 tux tplinux 4096 Jul 9 17:08 wscale

Now, I want to create a user to give read only permission to this folder. How can I do this?

first
777 means rwx for everybody: the owner, the group, and all other users.
r is for 'read', w is for 'write', and 'x' is for 'execute'

to change file permissions you use the command chmod
If you want the owner of 'wscale' to be the only one to have
the write permission, you

$ chmod 755 wscale
if you 'ls' you'll see that the group (tplinux) and the other
users have rx permissions

$ ls -l
total 4
drwxr-xr-x 2 tux tplinux 4096 2009-07-09 15:07 wscale

Now, if you want the group to have write permission and the
other users only rx permissions, you

$ chmod 775 bogus

see the difference?

$ ls -l
total 4
drwxrwxr-x 2 tux tplinux 4096 2009-07-09 15:07 wscale

#######################
instead of 'chmod 775' you can also use the form
chmod o-w (remove the write permission to users that are
not in this group)

you should
man chmod

zion_rulz 07-09-2009 03:02 PM

Thank you all for your response and assistance.

Can I have 2 different individual user IDs diff permission on a particular folder?
e.g. - Folder is DOWNLOAD
Users are 'wscale' and 'monitor'
can I assign rw for 'wscale' and r_x for 'monitor' on folder DOWNLOAD?
If yes, how? 'wscale' and 'monitor' are members of different usergroup.

Thanks.

Wim Sturkenboom 07-09-2009 04:02 PM

Read up on ACL (I suppose it is supported by Suse).

See http://www.linuxquestions.org/questi...?highlight=acl for my experience with it.


All times are GMT -5. The time now is 08:54 PM.