Solved

Priviledged Users

Posted on 2006-10-18
11
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17763576
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
ID: 17763748

 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
ID: 17763762
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:harmsingh
ID: 17763806

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
ID: 17763817
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17763824
0
 

Author Comment

by:harmsingh
ID: 17763850
How to write such script ?? Any reference please ??
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17763863
Such script will affect all users.
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
ID: 17763880
0
 

Author Comment

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

Expert Comment

by:sunnycoder
ID: 17763921
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

740 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