How to find a user's file permissions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to find a user's file permissions
# 8  
Old 03-19-2009
IMHO there are 2 aspects:
From a unix point of vue any user who has a an access (except chroot stuff) to a box can accees to all directories and files except those very few where "others" have no perms at all(and user is not in <group>...)... Having access doesnt mean the user can do what he wants: This depends on if he is owner or belongs to the group that has privileges...( and depends of the privileges too...)

From a webserver point of vue: it depends all how the server is configured (users can be defined for web services but dont have unix account...)e.g. an apache server will only show (directories...) what you have configured in httpd.conf
# 9  
Old 03-19-2009
Thanks for the reply.

I think i was not clear with 'access' in my previous post. , all I want to know in my script is a way to find if a 'userid' has read/write-permission to a file/dir. Again, 'userid' is not the owner of that file/dir and that 'userid' might be in a group.

thank you.
# 10  
Old 03-19-2009
I haven got the time to write the script for you...
But I will give you some clues:
Code:
ant:/home/vbe $ id
uid=200(vbe) gid=2(bin) groups=20(users),60(oper),104(hpsmc),160(sasdba),200(dba),220(prod),,519(mysql)
ant:/home/vbe $ ls -ld . |awk '{print $3}'
vbe
ant:/home/vbe $ ls -ld . |awk '{print $4}'
bin
ant:/home/vbe $ groups vbe
 bin  dba hpsmc mysql ols oper prod  sasdba  users

You would need a loop to see compare group with user's groups

This thread could give some ideas also

https://www.unix.com/unix-dummies-que...74-substr.html

Good luck

Last edited by vbe; 03-19-2009 at 03:38 PM.. Reason: shortening
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

2. Shell Programming and Scripting

File permissions for particular user

Hi, How can we assign file permissions for a purticular user, rather than giving to whole group. Thanks. (4 Replies)
Discussion started by: karumudi7
4 Replies

3. Shell Programming and Scripting

new-user permissions

Hi, i'm using a Unix machine. I login as root. when i create new users using useradd -m <user_name> their home directories will be created in /home/ directory with default permissons of 750. i.e., drwxr-x--- how can i change these default permissions..?? which file to access and what changes i... (2 Replies)
Discussion started by: sandeepyes
2 Replies

4. Shell Programming and Scripting

Script to find the user of a file and permissions

I have a list of files in a.txt file. For each of the files listed in that file, I would like to obtain the owner of the file and also, the permissions associated with that file. If possible, the group the owner belongs to as well. Can someone help me with a script to find that out. (1 Reply)
Discussion started by: ggayathri
1 Replies

5. UNIX for Dummies Questions & Answers

How to see a user's permissions on a directory

i know about ls, I know.... but some of our shares have a long messy list of acls and it is a lot to sort through.. without a grep option, unless you have a really nice one, is there a simple way to say: show me <USER> acl permissions on <SHARE> ? (1 Reply)
Discussion started by: glev2005
1 Replies

6. Solaris

user permissions

hi i want to display the usernames,usergroups user permissions and user home directory's with in a single command.and possibities are their for getting this output .. (9 Replies)
Discussion started by: tv.praveenkumar
9 Replies

7. UNIX for Dummies Questions & Answers

How to do i change the user permissions..

Hi everyone, There are couple of users of which i need to give 2 of the users admin rights so that they are able to run the administration commands like "zoneadm" and locale. When logged in as root i am obviously able to do that.please suggest any way by which the other 2 user's permissions... (1 Reply)
Discussion started by: sankasu
1 Replies

8. UNIX for Dummies Questions & Answers

user permissions question

I have an application where in a user uploads files into a directory that has a collection of image files, as well as a text file that is read by a web script later. The script imports the text file data into a database, then copies the image files to a secure location. Ideally it should remove... (1 Reply)
Discussion started by: cdw.lighting
1 Replies

9. UNIX for Advanced & Expert Users

How to find permissions/roles/priveleges of User

Hello Everyone, if we log on to unix server how do we find that what permissions/roles and priveleges are assigned to any particular user. Here i am not talking about the file permissions. Thanks (1 Reply)
Discussion started by: hardesh
1 Replies

10. UNIX for Advanced & Expert Users

Changing permissions of a user

So I need to change the permissions of my user account. I can access the root account on the server, but don't know how to change the permissions of my user account. I was advised to try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Discussion started by: achink125
3 Replies
Login or Register to Ask a Question