give permission to read a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting give permission to read a file
# 1  
Old 01-29-2009
give permission to read a file

I want to give tester only the account tester to view the file /var/mail/root nobody else but him and of course the owner root w/o changing the permisions of /var/mail/root -rw-------.

[tester@adminserver ~]$ cat /var/mail/root
cat: /var/mail/root: Permission denied
# 2  
Old 01-29-2009
Maybe try it via sudo.
# 3  
Old 01-29-2009
may i know how?
# 4  
Old 01-29-2009
You could check the man page for sudo on your system, if it is installed or also search the web, as a start showing your proactive search for a solution Smilie There is an official sudo page which explains everything also.

Example:

Edit the sudoers file to your needs using the command "visudo". For more help check the mentioned sites. It should have this line for the example output down there:
Code:
Cmnd_Alias DO = /bin/cat /data/tmp/testfeld/bla
tester localhost = NOPASSWD:DO

Code:
-rw------- 1 root root     5 2009-01-29 12:59 bla
tester@isau02:/data/tmp/testfeld$ cat bla
cat: bla: Keine Berechtigung
tester@isau02:/data/tmp/testfeld$
tester@isau02:/data/tmp/testfeld$ sudo /bin/cat /data/tmp/testfeld/bla
yoyo

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How do I give permission for the kill command?

<?php $comando = "kill -9 3104"; $output = shell_exec($comando); ?> I am running this web page, but it does not execute the command, in the log file it looks like this: sh: 1: kill: Operation not permitted How do I give permission to execute the command? (1 Reply)
Discussion started by: Rodrigo_Bueno
1 Replies

2. UNIX for Beginners Questions & Answers

How to give permissions to read write but not delete the file?

i want to give users the ability to create write and read files in other user directory , but not to have option to delete the file after created ( sticky bit not going to work here ... ) for example : i have user : manager with directory repository i have user : worker1 that need to write... (4 Replies)
Discussion started by: umen
4 Replies

3. Solaris

How to give full permission to a directory?

Hi, I have enabled the Apache webserver on my machime. Apache root directory is /etc/apache2 and the user in which the web server is configured is webservd,I guess. I have another user called perf. Under perf user there is /export/home/perf/v9 directory. I want to give the OS user of... (3 Replies)
Discussion started by: bikas89
3 Replies

4. UNIX for Dummies Questions & Answers

CHMOD....read only permission

After creating a user account...how do i verify if theres only read access on the account. If not read access would i enter chmod a-xw "username"? (2 Replies)
Discussion started by: bigben1220
2 Replies

5. UNIX for Advanced & Expert Users

HOw do i give a user cronjob edit/settings permission?

Hi, In a Unix Server when i 'su' to my name and type in crontab it says " You are not authorised......". Pls suggest what to do? How do i give myself permission so that I can schedule a cron. (2 Replies)
Discussion started by: debu
2 Replies

6. Solaris

give user permission on specific directory in solaris

dear all does any one give any user write permission using access control list or another way to solve this problem (1 Reply)
Discussion started by: murad.jaber
1 Replies

7. UNIX for Dummies Questions & Answers

Permission file questions--Please read!!!

1. I have an executable file that I have granted the users full permission "777" for it to work. I don't want the user to read this file! How can I prevent a user to read it? Thanks (4 Replies)
Discussion started by: bobo
4 Replies

8. UNIX for Dummies Questions & Answers

Read Permission

How can view the list of only those files & directories which have read permission..! (9 Replies)
Discussion started by: vineetrocks2005
9 Replies

9. UNIX for Dummies Questions & Answers

How to give permission for a specified user

Hi All, How can i give permission for a specific user ( eg. admin ) ? I tried with chmod admin+r prog.sh which doesnt work. Is there any way i can specify a user's name and give the permission? Thanks in advance. Saneesh Joseph. (1 Reply)
Discussion started by: saneeshjose
1 Replies

10. UNIX for Advanced & Expert Users

read permission but cant ls -l it.

ok what is the signifigance of the -l that wont let you list the contents of a directory you clearly have access to list files. what am i missing /tmp$ls -l hold hold/file1: Permission denied total 0 /tmp$ls hold file1 /tmp$ls -l dr-x---r-- 2 root other 179 Apr 23... (6 Replies)
Discussion started by: Optimus_P
6 Replies
Login or Register to Ask a Question