HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sudoers Question
Operating System - HP-UX
1828159
Members
2884
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-21-2003 01:27 PM
01-21-2003 01:27 PM
Sudoers Question
I have production and development boxes in my environment. I want to setup sudoers so that users can have different sudo capabilities for production and development. For example, say my production boxes are dog and cat, and my development boxes are mouse and bird, how do I set it up so that the user john can do command1 in production and command2 in development. Also assume pat can do command1 and command2 in both environments. Is this correct?
Host_Alias PROD=dog,cat
Host_Alias DEV=mouse,bird
pat ALL=command1,command2
john PROD=command1
john DEV=command2
Do I make 2 separate entries for john, or does it look more like:
Host_Alias PROD=dog,cat
Host_Alias DEV=mouse,bird
pat ALL=command1,command2
john PROD=command1 DEV=command2
I'm just not sure on the formatting, any help would be appreciated.
Host_Alias PROD=dog,cat
Host_Alias DEV=mouse,bird
pat ALL=command1,command2
john PROD=command1
john DEV=command2
Do I make 2 separate entries for john, or does it look more like:
Host_Alias PROD=dog,cat
Host_Alias DEV=mouse,bird
pat ALL=command1,command2
john PROD=command1 DEV=command2
I'm just not sure on the formatting, any help would be appreciated.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2003 01:33 PM
01-21-2003 01:33 PM
Re: Sudoers Question
2 seperate entries are needed. Here is an example of our sudoers file.
#
# /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
##
# User alias specification
##
User_Alias OPERATORS = %uxsysopr
User_Alias SYSADMINS = %uxsysadm
User_Alias BAKADMINS = %uxbakadm
##
# Runas alias specification
##
Runas_Alias ROOT = root
##
# Cmnd alias specification
##
Cmnd_Alias MOUNT_CDROM = /opt/CHS/root/bin/mount_cdrom
Cmnd_Alias UNMOUNT_CDROM = /opt/CHS/root/bin/unmount_cdrom
Cmnd_Alias CREATE_BOOT_TAPE = /opt/CHS/root/bin/create_boot_tape
Cmnd_Alias DISKINFO = /usr/sbin/diskinfo
##
# Override builtin defaults
##
Defaults syslog=auth
Defaults !lecture
Defaults mail_no_perms
##
# User specification
##
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
# operator may run
OPERATORS ALL = (ROOT) MOUNT_CDROM, UNMOUNT_CDROM, CREATE_BOOT_TAPE
SYSADMINS ALL = (ROOT) MOUNT_CDROM, UNMOUNT_CDROM, CREATE_BOOT_TAPE, DISKINFO
BAKADMINS ALL = (ROOT) DISKINFO
#
# /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
##
# User alias specification
##
User_Alias OPERATORS = %uxsysopr
User_Alias SYSADMINS = %uxsysadm
User_Alias BAKADMINS = %uxbakadm
##
# Runas alias specification
##
Runas_Alias ROOT = root
##
# Cmnd alias specification
##
Cmnd_Alias MOUNT_CDROM = /opt/CHS/root/bin/mount_cdrom
Cmnd_Alias UNMOUNT_CDROM = /opt/CHS/root/bin/unmount_cdrom
Cmnd_Alias CREATE_BOOT_TAPE = /opt/CHS/root/bin/create_boot_tape
Cmnd_Alias DISKINFO = /usr/sbin/diskinfo
##
# Override builtin defaults
##
Defaults syslog=auth
Defaults !lecture
Defaults mail_no_perms
##
# User specification
##
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
# operator may run
OPERATORS ALL = (ROOT) MOUNT_CDROM, UNMOUNT_CDROM, CREATE_BOOT_TAPE
SYSADMINS ALL = (ROOT) MOUNT_CDROM, UNMOUNT_CDROM, CREATE_BOOT_TAPE, DISKINFO
BAKADMINS ALL = (ROOT) DISKINFO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2003 02:17 PM
01-21-2003 02:17 PM
Re: Sudoers Question
Hi,
You can seperate them using :
john PROD=command1:DEV=command2
-Sri
You can seperate them using :
john PROD=command1:DEV=command2
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP