Restrict User to only execute the file.


 
Thread Tools Search this Thread
Operating Systems Linux Restrict User to only execute the file.
# 1  
Old 04-04-2010
Restrict User to only execute the file.

Hi Gurus ,

I hope you are doing great .
Other than owner of the file , OTHERS and GROUP should be restricted from read or write a file created by the owner.
OTHERS and GROUP should be only allowed to execute the file.


Thanks in advance.

Last edited by palanisvr; 04-04-2010 at 03:38 AM..
# 2  
Old 04-04-2010
Read...

Code:
man chmod

# 3  
Old 04-04-2010
Hi Malcom,
thx for the advice.
I am aware of chmod command but as you know for a user to execute a file he has to have a read permission , which in my case should not be allowed .
Pls advice.
# 4  
Old 04-04-2010
Quote:
Originally Posted by palanisvr
Hi Malcom,
... but as you know for a user to execute a file he has to have a read permission ..
A user needs only execute permission to execute a file and does not need read permission, unless it is a script.
# 5  
Old 04-04-2010
Yes it is a script which contains authenticating details .
# 6  
Old 04-04-2010
I have not tested this, but what you could do I suppose, is create a functional user that can not logon but that has the right to read and execute the script while other users can not. You can then use sudo and a sudoers definition so that a certain group of users or if you like eveyone can execute the script as that functional user without a password.
# 7  
Old 04-04-2010
Thanks for your interest.

Actual scenario :

we have sqlconnect string stored in a file. The same file will be used by multiple user to connect to a Database by execting the file. Our motive is to make sure that other than owner no one should be allowed to view or write the file content.

I have tried the same but i am unsucesseful as one cant execute a file unless and until he has a read permission on the file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Is there a way to restrict a user (owner) to execute scripts from a specific directory

Hello, I have a user Bob on a RHEL 7 server1. Where his script area is "/home/Bob/scripts/" and he is the owner for this directory. On the server1, there is a NFS mount from another server2, with path as "/global/work/" and Bob is the owner for this directory too in server2. (Same UID and GID... (5 Replies)
Discussion started by: karumudi7
5 Replies

2. Shell Programming and Scripting

Other user should not read the file but can execute

Hi, I have one script for which I want that other user should not read the script file but can execute. Is there any method ? I tried by giving 711 but it gives Permission denied to other users. For Generic User id as a work around , I have created alias in .bashrc file and other user... (4 Replies)
Discussion started by: Amit Joshi
4 Replies

3. AIX

How to restrict user to a particular directory?

hi, I want to restrict some user access to only 1 directory (including all sub-directories/files in it). can you please explain me, how can we do this? example; Filesystem GB blocks Used Free %Used Mounted on /dev/hd4 2.61 1.02 1.59 40% / /dev/hd2 ... (7 Replies)
Discussion started by: aaron8667
7 Replies

4. Red Hat

Restrict user access

Hi there I have an application user on my system that wants accesses to these file systems as such: rwx: /SAPO /SAPS12 /R3_888 /R3_888B /R3_888F /R3_888R r: /usr/sap these are the existing FS permissions:ownerships: # ls -ld /SAPO (9 Replies)
Discussion started by: hedkandi
9 Replies

5. UNIX for Dummies Questions & Answers

Restrict user access.

Hi All, How can we restrict a particular user access to a particular shell in solaris 10. Thanks in Advance. (5 Replies)
Discussion started by: rama krishna
5 Replies

6. Shell Programming and Scripting

Restrict modification of a file while it is already in use by another user?

How to restrict modification of a file while it is already in use by another user? If a file is in use by one user account, how to restrict it so that no one else can change it until its closed by the first user? (3 Replies)
Discussion started by: bdiwakarteja
3 Replies

7. UNIX for Dummies Questions & Answers

Restrict command for an user ?

Hi everyone ! I got "viewer" and "root" user on a *nix computer. When i log in using "viewer" I only can use "df" command. When I try another command like "ls" it say : -bash: ls: command not found I checked permission of "/bin/ls" file, it has excute permission for everyone. Inside home... (4 Replies)
Discussion started by: camus
4 Replies

8. AIX

New user and restrict path

Hello I have a question in Aix 5.3 can I create a user, that only can see a specify path. I mean the user log in the default path its /home/newuser he type cd the path that need to check /example/directory_check but if he wants to go to / or any other path. we can not do this. I only... (1 Reply)
Discussion started by: lo-lp-kl
1 Replies

9. Solaris

restrict a user to certain command

Hi all, I am using Sun OS 5.10. I am new to Unix. Is there some way to restrict a specific user to certain command say "/usr/bin/more" ?? for example: I want that user1 can execute more command & user2 can't. Can we somehow edit .profile file in the home directory of user to achieve... (1 Reply)
Discussion started by: vikas027
1 Replies

10. Shell Programming and Scripting

How to restrict the number of commands user can execute

Hi all, Is there a way to prevent users from being able to execute commands less a select few? For instance, I wish to allow the user to be only able to execute 1 command, which is exec a.sh. He should not be able to do simple stuff such as ls, cd, rm, cat, etc. Can this be achieved? ... (1 Reply)
Discussion started by: rockysfr
1 Replies
Login or Register to Ask a Question