LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-19-2016, 11:59 PM   #1
Z0sickx
LQ Newbie
 
Registered: Jun 2016
Posts: 17

Rep: Reputation: Disabled
User account restrictions


I have a JR I hired a month ago to help with a particular application. Anyways I want to practice least privledge here. My question is can I make an account that does the following:

Can only access his home directory
Can only access a specific folder directory (/opt)
Run specific commands ( Ifconfig, top, etc)
Run specific scripts we custom made that need access to specific folder path

Though I use redhat and CentOS on a daily basis I am no expert and only know enough to to move around and maintain the COTs product it houses. The main goal is to avoid giving him root access.

Thanks
 
Old 06-20-2016, 12:49 AM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
By default, he'll have access to his home directory anyway but for the rest of the requirements I think ACL will be most suitable. Go through the below link for the know how:

https://access.redhat.com/documentat...s-setting.html
 
Old 06-20-2016, 01:34 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,310
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by Z0sickx View Post
Can only access his home directory
Can only access a specific folder directory (/opt)
Run specific commands ( Ifconfig, top, etc)
Run specific scripts we custom made that need access to specific folder path
It's complicated because the systems default open. The main way I can think of would be to use "rbash" for his shell and "mount --bind" to duplicate various target directories under his home.

Keeping him from reading the other /home directories could be done by modifying their permissions o= with chmod to turn of access for "other" If this presents issues for people that are used to sharing, then make a group for the sharers and, if the group permissions are already in use, then consider ACLs as in the link above.

Then make a symbolic link from inside his account to the /opt directory or else use "mount --bind" to make the content accessible in two places at once.

To only run specific commands, you'll have to empty out his $PATH settings and point it to a path directory made just for him, such as /usr/local/jr/bin/ Then in that directory make hardlinks to the filnames of the programs you want him to be allowed to use, such as "ifconfig", "top", and so on. If JR is to modify anything with "ifconfig" or other programs that require root, then you'll have to add at least one specially crafted formula per program in /etc/sudoers and let them use "sudo". The formulas will have to be very specific to prevent abuse, so avoid any use of * anywhere in the formulas.

About the scripts, just add hard links to them to the $PATH for the JR account. Accessing the specific scripts that need access to specific paths might be harder. You'll have to test the scripts under "rbash" and modify them accordingly because they won't likely work with absolute paths. You may have to use modified scripts for him and place the target directories in his home directory using "mount --bind"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SSH - How can I only allow a key pair login for my user account not root account? shanekelly Linux - Security 5 01-25-2013 09:45 AM
Setting user account restrictions for cable network with server on Debian 4.0! aliasgherman Linux - Networking 1 04-10-2007 09:29 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
User name restrictions AndeAnderson Linux - Newbie 4 04-11-2005 03:29 PM
FTP access using root account - restrictions alaerte Linux - Software 7 04-03-2003 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration