Solved

Priviledged Users

Posted on 2006-10-18
11
347 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
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
 

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

911 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

25 Experts available now in Live!

Get 1:1 Help Now