- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: sudoers file
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
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
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
09-25-2013 08:22 AM
09-25-2013 08:22 AM
sudoers file
Hi
User_Alias ADMINS = user1, user2
root ALL = (ALL) ALL
ADMINS ALL = NOPASSWD: ALL
--> 1.Can you explain me the Line 1,2 3.
--> 2.suppose if i am adding user3 instead of root in Line 2 ,at this point what it refers to.
- Tags:
- sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2013 12:10 PM
09-25-2013 12:10 PM
Re: sudoers file
Line 1:
> User_Alias ADMINS = user1, user2
This defines an "user alias": a collective name for a set of one or more users, for the purpose of identifying the users who can do something with sudo.
There are other alias types: Host_Alias for defining a set of hosts, Runas_Alias for defining a set of users someone can run commands as, and Cmnd_Alias for defining a set of commands you might allow to be run through sudo.
You don't *have* to use any of these aliases, but if your sudo configuration is complex, the aliases will allow you to group things so you don't have to repeat long lists of users/hosts/commands.
Line 2:
> root ALL = (ALL) ALL
This is the basic form of a sudoers user specification.
It says that root is allowed to use sudo on all hosts using this sudoers file, to run all possible commands, as any user.
When a sudoers file is used on a single host, most sysadmins won't bother using the actual hostname in the hosts field; they will type "ALL" in the host field instead.
If you have a centrally managed sudoers file that is used on multiple hosts, you can use the hosts field to restrict some sudoers user specifications to a particular (set of) host(s) only.
Line 3:
> ADMINS ALL = NOPASSWD: ALL
This is another user specification, using the ADMINS user alias defined on line 1.
It also has the NOPASSWD tag, indicating that no password prompt will be presented before running the command.
The users listed by the ADMINS user alias may run all commands as root (if the run-as field is omitted, the default value of (root) is assumed.
So, line 3 could is exactly equivalent to:
user1, user2 ALL = (root) NOPASSWD: ALL
You might want to write a comment like this as a syntax reminder to your sudoers file:
# <WHO does> <WHERE> = (<as WHO>) <WHAT>