Solved

Priviledged Users

Posted on 2006-10-18
11
346 Views
Last Modified: 2013-12-15

 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.
0
Comment
Question by:harmsingh
  • 7
  • 4
11 Comments
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
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
0
 

Author Comment

by:harmsingh
Comment Utility

 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.
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
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
0
 

Author Comment

by:harmsingh
Comment Utility

Please note that the 2 requirements are for different users.

1. Sounds good . Will try out and confirm.
2.Wrapper script ??
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
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.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
0
 

Author Comment

by:harmsingh
Comment Utility
How to write such script ?? Any reference please ??
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
Such script will affect all users.
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
Comment Utility
0
 

Author Comment

by:harmsingh
Comment Utility
I really have to accept now . :-) ....Thanks.
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now