- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Modifying the sudo file
Operating System - Linux
1753667
Members
5930
Online
108799
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
Discussions
Discussions
Forums
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
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-28-2010 03:59 PM
тАО01-28-2010 03:59 PM
Modifying the sudo file
Hi there --
I need to modify the sudo file to allow a user account, nagios, the ability to run a particular command, du, as root user. The nagios user on the machine in question is set up with the /sbin/nologin shell. The recommended syntax is the following:
nagios ALL=(root) NOPASSWD: /usr/bin/du
My question is the following, when looking at the sudo file, is there a particular section where the above syntax should be inserted in order for it to work? One section that comes to mind is:
Cmnd alias specification
and another possibility is:
User privilege specification
What would be the best way to go? Thanks.
I need to modify the sudo file to allow a user account, nagios, the ability to run a particular command, du, as root user. The nagios user on the machine in question is set up with the /sbin/nologin shell. The recommended syntax is the following:
nagios ALL=(root) NOPASSWD: /usr/bin/du
My question is the following, when looking at the sudo file, is there a particular section where the above syntax should be inserted in order for it to work? One section that comes to mind is:
Cmnd alias specification
and another possibility is:
User privilege specification
What would be the best way to go? Thanks.
A Journey In The Quest Of Knowledge
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 11:31 PM
тАО01-28-2010 11:31 PM
Re: Modifying the sudo file
The correct location for your planned line would be "User privilege specification".
The sections in the default sudoers file are just comments: you can probably configure things in any order you want, although if you use aliases, it might be required to _define_ an alias first before _using_ it in a privilege specification.
If you need to authorize a long list of other commands for Nagios, you might wish to use a command alias:
----
Cmnd_Alias NAGIOSCMDS = /usr/bin/du, /usr/bin/something_else, /usr/sbin/a_third_command,
nagios ALL=(root) NOPASSWD: NAGIOSCMDS
----
When your sudo configuration becomes more complex, using the aliases allows you to group things so that you can keep the actual privilege specifications short, simple and easy to understand.
But if you need just to authorize one user to run one or two commands, aliases are not necessary.
MK
The sections in the default sudoers file are just comments: you can probably configure things in any order you want, although if you use aliases, it might be required to _define_ an alias first before _using_ it in a privilege specification.
If you need to authorize a long list of other commands for Nagios, you might wish to use a command alias:
----
Cmnd_Alias NAGIOSCMDS = /usr/bin/du, /usr/bin/something_else, /usr/sbin/a_third_command,
nagios ALL=(root) NOPASSWD: NAGIOSCMDS
----
When your sudo configuration becomes more complex, using the aliases allows you to group things so that you can keep the actual privilege specifications short, simple and easy to understand.
But if you need just to authorize one user to run one or two commands, aliases are not necessary.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2010 03:18 AM
тАО01-29-2010 03:18 AM
Re: Modifying the sudo file
Cmnd_Alias is the better option.
All things excellent are as difficult as they are rare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2010 03:26 AM
тАО01-29-2010 03:26 AM
Re: Modifying the sudo file
>My question is the following, when looking at the sudo file, is there a particular section where the above syntax should be inserted in order for it to work?
It is not important where (what line no.) you will put the new line.
There are no "sections" in sudoers file.
The lines preceeded by # are comments. And this is all.
It is important to respect the sintax.
You do not need aliases if you only assign right to one or two users and/or to one/two or so commands
Best regards,
Horia.
It is not important where (what line no.) you will put the new line.
There are no "sections" in sudoers file.
The lines preceeded by # are comments. And this is all.
It is important to respect the sintax.
You do not need aliases if you only assign right to one or two users and/or to one/two or so commands
Best regards,
Horia.
Best regards from Romania,
Horia.
Horia.
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP