User access !
Hi all.
This query seems stupid but i thought i shall still ask. If i want to know what access does a particular user has on system, so how can i do that ? Now this question seems very subjective. User can have read/write/access on many files, so is there any way to filter it, like which files a particular user can read or write or execute ? |
Are you talking about file permissions and ownership? You can chmod to whatever you need, and chown for a specific user and group.
Cheers, Josh |
Dear Sir,
I meant is there any way to see which user can access which file ? |
Yes, you can use ls -al to list the details of the files you are working with and you can see specifically what user and group owns the file. You can use chmod to remove permissions for the "other" to deny read, write, and execute permissions to other users that do not own the file. Hope that helps,
Josh |
CONCEPT
In my home folder if I run 'ls -al' I get something like this drwxr-xr-x 57 lxuser lxuser 4096 2011-03-01 13:21 . type : (d=directory,-=file) permission : rwx(owner) r-x(group) r-x(others) 57=number of hard links You can change permission using 'chmod' while ownership can be changed using 'chown'. r=4,w=2,x=1 so calculate $chmod 432 test interpretation : 432 means 4=r for owner , 3=2+1=w+x for group & 1=x for others. $chown owner:group file In above example . (current folder) belongs to only lxuser |
if you want to find files belonging to each user in particular_folder
Then Code:
find particular_folder -type f -exec 'ls' '-al' '{}' ';' | sort -k 3 # replace 'sort -k 3' by 'grep -i username' (without quotes) if you do not want to see all users To find files belonging to particular group with specific permission Code:
find folder_name -group gname -perm number -type f -exec 'ls' '-al' '{}' ';' |
All times are GMT -5. The time now is 07:12 PM. |