- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo security issue with vi, more commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 11:43 AM
тАО07-18-2005 11:43 AM
sudo security issue with vi, more commands
I use sudo for controlled access in HP boxes and have given access of more and vi commands to users. Now when I run, for example,
$/usr/bin/sudo /usr/bin/more filename
from more , I can escape to shell ( ! ) and this shell would be a root shell and I can execute whatever from there and this is a BIG security loophole and want to close it.
I can not stop access to these command as well.
Pls tell me if there is any workaround for this.
thanks
deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 12:03 PM
тАО07-18-2005 12:03 PM
Re: sudo security issue with vi, more commands
Make the suid script act as the restricted shell for this user. You can do this by setting the /etc/passwd entry for this user not a shell, such as /sbin/sh, but instead as the name of the script, /usr/contrib/bin/rapp_menu.
Note: The r before app_menu signals a restricted shell.
The effect then is that the script runs as root, but the usercannot suspend the script and drop to a root subshell. When the script is complete, the user is automatically logged off.
Hope this sprays some light to ur query
Regards
Vinod K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 12:06 PM
тАО07-18-2005 12:06 PM
Re: sudo security issue with vi, more commands
So here's how you close it. No one gets sudo access until you create a list of commands, and in some cases, the only allowable parameters. For instance, you can allow mount and umount but only if the 1st parameter is the device file for the CDROM drive.
Better yet, NO ordinary user gets a shell prompt. Instead, they get a menu that they cannot escape. The menu has a list of commands the user can run.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 01:59 PM
тАО07-18-2005 01:59 PM
Re: sudo security issue with vi, more commands
If there are a lot of users that need access to some files, then you need to look at group permissions for the file and those users. The same thing applies whether you are talking about vi or more.
There is really no good reason I can thing of for normal users to have root access to run more or vi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 03:09 PM
тАО07-18-2005 03:09 PM
Re: sudo security issue with vi, more commands
I think sudo is not your friend in this situation. I would go with other member's suggestion of user/group permission. List out all the users who has to access a particular file, add them to a particular group and give that group write access to the file.
As far as I know you only need read permission for a file to use more, so try to give group read permission to use with more.
Regards,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 06:17 PM
тАО07-18-2005 06:17 PM
Re: sudo security issue with vi, more commands
thank You!
I think You're the first sudo user I ever meet actually configuring it :)
At times will people show me sudo, being very happy about the increased security it provides them.
Until I ask them to type 'sudo passwd root', that is. After that I ask them to read the documentation and properly use it....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 06:27 PM
тАО07-18-2005 06:27 PM
Re: sudo security issue with vi, more commands
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2005 06:33 PM
тАО07-18-2005 06:33 PM
Re: sudo security issue with vi, more commands
Sometimes the policy management of Windows/AIX seems much more beautiful, if it weren't even worse ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2005 06:25 PM
тАО07-19-2005 06:25 PM
Re: sudo security issue with vi, more commands
If you want to lock down vi and more (this is not perfect), create a .exrc file, or set the shell variable $EXINIT, and set the shell to "nologin". This should prevent the user from shell'ing out of either command.
Example:
set shell=/bin/nologin
set exrc=noexrc
chmod 550 ~/.exrc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2005 11:12 PM
тАО07-20-2005 11:12 PM
Re: sudo security issue with vi, more commands
Be also careful with the command "pg".
So we changed that the user is only allowed to view files via the command cat.
That works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 12:03 AM
тАО07-21-2005 12:03 AM
Re: sudo security issue with vi, more commands
Note the ! characters for the root acces.
%baradm ALL=NOPASSWD:SU,!/usr/bin/su *root*,!/usr/bin/su "", \
!/usr/bin/su -,!RLOGIN,READ,DV,KILL,PRINTING,FIND,ADMINS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 12:09 AM
тАО07-21-2005 12:09 AM
Re: sudo security issue with vi, more commands
If group permissions won't solve the problem, then if you get the newest version of "sudo", it has the ability to run as any user (not just root). That way you can give permission to the file without giving away the whole store.
HTH
-- Rod Hills