File permissions for particular user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File permissions for particular user
# 1  
Old 08-06-2012
Question File permissions for particular user

Hi,

How can we assign file permissions for a purticular user, rather than giving to whole group.


Thanks.
# 2  
Old 08-06-2012
Check out the chmod(1) man page. Without any indication of what permissions you want for "the file's owner", "members of the file's group", and "everyone else" it is hard to give much more in the way of a suggestion.
# 3  
Old 08-06-2012
Question

I have a file abc.txt and have to give Full permissions to a User John, who is in sxy group. But the permissions won't have to be applicable to whole sxy group users.
# 4  
Old 08-06-2012
What type of file. (Does John need to execute it [if it is a regular file], search it [if it is a directory]? What permissions to you want to grant to members of group sxy other than John? What permissions do you want to grant to users who are non John and are not in group say? Am I correct in assuming that the file in question is owned by John?
# 5  
Old 08-06-2012
Perhaps you should take a look at Access Control Lists?

Code:
$ echo Hello > somefile
$ ls -le somefile
-rw-r--r--  1 scott  staff  6  6 Aug 21:40 somefile
$ chmod 600 somefile
$ ls -le somefile
-rw-------  1 scott  staff  6  6 Aug 21:40 somefile
$ su oracle
Password:
bash-3.2$ cat somefile
cat: somefile: Permission denied
bash-3.2$ exit
$ chmod +a "oracle allow read" somefile
$ ls -al somefile
-rw-------+ 1 scott  staff  6  6 Aug 21:40 somefile
$ su oracle  
Password:
bash-3.2$ cat somefile
Hello
bash-3.2$ exit
$ su testuser
Password:
bash-3.2$ cat somefile
cat: somefile: Permission denied

How / if you implement this may vary on which OS you are using.
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. Homework & Coursework Questions

Check the permissions user

i have some question for example: suppose we have the Public folder as follows: https://www.unix.com/attachments/shell-programming-scripting/2759d1334070669-check-permissions-linux-user-capture.png If user enter: -Kenshin or /home/kenshin/Public output: abc: kenshin: rw my shell:... (1 Reply)
Discussion started by: kingkner
1 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

How to find a user's file permissions

Hi. I would like to know if there is any command that could list simple file permissions (like , R , RW..etc) for a given uid/userid and on a given file/dir. (9 Replies)
Discussion started by: ram123
9 Replies

9. 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

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