hi,
i need to give read and write permission on specific folder for specific user.else that user can,t do anything on the server.help me out
thanks
hi,
i need to give read and write permission on specific folder for specific user.else that user can,t do anything on the server.help me out
thanks
To set permission use chmod command - Unix or Linux commands for changing user rights
To change folder / file permission use chown command - How to use chmod and chown command
All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]
Hi,
you can use the 'setfacl' command to achieve this.
eg:
[root@ldp tmp]# touch sample.txt
[root@ldp tmp]# getfacl sample.txt #list current ACL
# file: sample.txt
# owner: root
# group: root
user::rw-
group::r--
other::r--
[root@ldp tmp]# chmod 700 sample.txt
[root@ldp tmp]# getfacl sample.txt
# file: sample.txt
# owner: root
# group: root
user::rwx
group::---
other::---
[root@ldp tmp]# setfacl -m u:aneesh:rw sample.txt # give the read,write access to user aneesh
[root@ldp tmp]# getfacl sample.txt
# file: sample.txt
# owner: root
# group: root
user::rwx
user:aneesh:rw-
group::---
mask::rw-
other::---
By using setfacl command you can add as many users as you like.
The easiest way to do what you want would be to set the folder's owner group to a group in which the user belongs.
Than you set your folder's group permission like you want (using chmod)Code:groupadd <group_name> usermod -a -G <group_name> <username> chgrp <group_name> <your_folder>
There are currently 1 users browsing this thread. (0 members and 1 guests)