How to restrict the perticular command to user


 
Thread Tools Search this Thread
Operating Systems Solaris How to restrict the perticular command to user
# 1  
Old 11-26-2008
Bug How to restrict the perticular command to user

Hi all,

I want to restrict the perticular command to user.
ex: CD, CP, mv etc .,

"A" user cannot user CD, CP, mv commands from his home directory.

so please let me know the procedure how to restrict the commands access to user "A".

I really thankfull to all. Please help me out.

regards
krishna
# 2  
Old 11-26-2008
Hammer & Screwdriver While a skilled user might figure out around this...

Set the user's PATH to use . as the first location.
Then in their home directory, make a file such as the following:
Code:
> cat cp 
echo "cp command execution not allowed"
exit 1

(make sure to do a chmod +x cp so it can be executed)

Then, if the user tries to execute a cp command from the directory with your cp script, they will get an error.

Not foolproof, but one thought.

By the way, back in the early PC days I had to do many things like this - especially for the format command. Amazing how many early computer users reformatted their own hard disk drive rather than the floppy disk. They would type format rather than format a: and then -- poof -- gone would be their hard disk and all its contents.
# 3  
Old 11-26-2008
there are many different ways you could copy a file:
Code:
cp file1 file2
mv file1 file2
cat file1 > file2
more file1 > file2
less file1 > file2
awk 'BEGIN{ORS="\n"};1' file1 > file2
sed n file1 > file2

You would be best off creating a menu system for those users so they can only run certain programs and not allowing shell access.
# 4  
Old 11-26-2008
You can give the user a restricted shell like rksh. That would prevent him to use the cd command.

As of cp, mv and so on, use ACLs to protect the homedir files from the user and use a restricted PATH to limit the commands that user will be able to launch.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Restrict ssh for particular user

Dear Concern, We want to restrict ssh for particular user "oracle". Our HP UX version is as below. Please advise. # uname -a HP-UX tabsdb02 B.11.31 U ia64 2963363594 unlimited-user license (2 Replies)
Discussion started by: makauser
2 Replies

2. UNIX for Dummies Questions & Answers

Restrict a user from Executing particular command

hi how to restrict a user ro run rm command. In this scenario we have a user/group has below in sudoers user ALL=(ALL) ALLis there a way to restrict the user from just executing rm command (9 Replies)
Discussion started by: robo
9 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. Red Hat

Restrict user to a particular directory

Hi I have a Fedora10 server and i need a particular user to view files only in a particular folder. All other files in other folders having "read" permission for all shouldn't be accessible to this user. Please let me know if ther's a way. Thanks, HG (5 Replies)
Discussion started by: Hari_Ganesh
5 Replies

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

7. Shell Programming and Scripting

write permission to a perticular user to a directory

Hi, The requirement is like, the program needs 2 argument one is user_id and second one is directory path. My script will check if that user_id has write access to the directory path. The directory path may be in any file system like AFS or NFS. Can any one please suggest some points to... (1 Reply)
Discussion started by: siba.s.nayak
1 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. Solaris

how to restrict the perticular commands to users

Hi all, How to restrict the perticular commands to users(or perticular users) in solaris10? Could you please assist me the precedure for above issue. Thanks & Regards krishna (0 Replies)
Discussion started by: krishna176
0 Replies
Login or Register to Ask a Question