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

Set the user's PATH to use . as the first location.
Then in their home directory, make a file such as the following:

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

there are many different ways you could copy a file:

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.

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.