- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: sudo setup
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
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
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
01-20-2009 07:56 AM
01-20-2009 07:56 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 08:09 AM
01-20-2009 08:09 AM
Re: sudo setup
Not possible.
>>I do not want to rely on users typing sudo before every command. I know nobody will do this
If they want their commands to run properly they WILL do it.
The other option is to set up an alias for whatever command(s) the user will run.
alias ssu='/usr/local/bin/sudo su -'
Thus, when the user types 'ssu' at the prompt it would run the 'sudo su -' command for them.
This is about all you will be able to do. There is no way to tell the shell to prepend 'sudo' to every command typed. You really would not want to do that anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 08:28 AM
01-20-2009 08:28 AM
Re: sudo setup
Well let me give you a little bit of background. There are only two users of our HP-UX servers. The two of us are both administrators and regularly use the root account. I cannot rely on the other admin to type sudo in order for it to log his actions.
SOX is making us give a paper trail as to which one of us are using the root account when and what we are doing while logged in as root. I believe sudo will give me the proper logging. I have also looked at Symark's Powerbroker. While extremely powerful, it is overkill. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 09:05 AM
01-20-2009 09:05 AM
Solution- visudo
- create a user alias defining your root users:
User_Alias ROOT_USERS = user1, user2
- Define the su to root command:
ROOT_USERS ALL = NOPASSWD: /usr/bin/su [-]
Then in the .profile for each user, add:
sudo su -
This will su them to root upon login into their account using sudo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 11:15 AM
01-20-2009 11:15 AM
Re: sudo setup
True, BUT it will NOT log any commands the are issued AFTER you become root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 11:40 AM
01-20-2009 11:40 AM
Re: sudo setup
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=50000
export HISTSIZE
This will create a history file for each user that becomes root with the date.
Also, for the above sudo commands to work, each user needs to be in the SU_ROOT_GROUP defined in /etc/default/security, if they aren't already.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 11:50 AM
01-20-2009 11:50 AM
Re: sudo setup
We had a miss on our SOX audit last year since only two of us log into the machines. We both tend to log in with the root account. We have since started logging in with our user accounts and su-ing to root as needed. But we still are lacking proof that only the two of us are using the root account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 12:08 PM
01-20-2009 12:08 PM
Re: sudo setup
grep '[a-zA-Z0-9]-root' /var/adm/sulog
(shows everyone that became root)
Also, to show all sudo commands run as root:
grep "sudo.*USER=root" /var/adm/syslog/syslog.log
As long as these logs are archived for long period, i would think that would be proof enough. It has been for our security audits.
Do the auditors have any recommendations for correcting the finding? I'd be interested to know what they are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 01:46 PM
01-20-2009 01:46 PM
Re: sudo setup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2009 01:46 PM
01-20-2009 01:46 PM