Link to home
Start Free TrialLog in
Avatar of harmsingh
harmsingh

asked on

Priviledged Users


 Hi Experts!!,

We are using RHEL AS 2.1 system.
1. We want to give certain priviledged commands execution permission to Valid Linux Users.

 E.g  A user called test should be able to execute priviledged commands such as
 
   fdisk , setup etc. But he should not be able to execute any other priviledged commands.

 How do I give such authority to a particular user.


2. How do we restrict a particular user to his home directory. He should not be able to

   go anywhere else . He should not be even permitted to see(read) the files in any other
    directory other than his home directory. He should not be even go ( "cd" ) to any other directory. How do we setup such user ? I know chroot is one way. But how to configure it.

Please Help.
Avatar of sunnycoder
sunnycoder
Flag of India image

Hi harmsingh,

1. Use sudo utility ... "Allows administrator to give restricted root access."
man sudo
http://www.courtesan.com/sudo/
http://www.courtesan.com/sudo/man/sudo.html

2. Set directory permissions as 0700, i.e. only the owner would be able to read,write and browse the directories .. Others can neither read nor write nor browse the directories.

man chmod

Cheers!
sunnycoder
Avatar of harmsingh
harmsingh

ASKER


 Please go thru the question again. Our requirement is somewhat different


1. We dont want to give a particular user , administrative sudo access . With this he would be able to execute all the administrative commands. We just want a user should be able to execute few defined administrative commands and not all .

2. We expect the user to be restricted to his home directory such that this user is not allowed to go anywhere else other than his home dir. He should not be able to (ls/cd) to any of the directories.
Hope I'm clear now.
1. That is exactly what sudo does ... It does not delegate root access in totality .. You can configure which privileged commands can be executed by a user. Take some time to read the man page - First line from the description in man page "sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file."

2. If directories have permissions 0700, A user will be restricted to home directory only as that is all user would own.
If this solution sounds too extreme, you can use a wrapper script to be used as cd/ls command but that would not prevent user from using some other commands or even custom code to access other directories

Please note that the 2 requirements are for different users.

1. Sounds good . Will try out and confirm.
2.Wrapper script ??
Wrapper script ... this would be installed in place of the command .. It would first verify if user has access permissions of the directory he/she is trying to access .. If yes it would call actual cd command else it would throw an error and exit.
How to write such script ?? Any reference please ??
Such script will affect all users.
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I really have to accept now . :-) ....Thanks.