- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- sudo NOPASSWD issue
Operating System - Linux
1752843
Members
4047
Online
108789
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
Go to solution
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
тАО11-25-2009 05:49 AM
тАО11-25-2009 05:49 AM
I am running Red Hat 5.3 and have coded sudo for a user to execute some commands with the NOPASSWD option...
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
A sudo -l shows the correct setting that I added:
-> sudo -l
User infort1 may run the following commands on this host:
(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
[cvoisaf01->/osg1/home/infort1]
->
However, when the infort1 user tries to execute the on of the scripts, it is still asking for the password:
-> sudo /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh -c DISTCLUSTER -h /infinys/local/orl/HA
Password:
[cvoisaf01->/osg1/home/infort1]
->
Any ideas as to why this isn't working ??
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
A sudo -l shows the correct setting that I added:
-> sudo -l
User infort1 may run the following commands on this host:
(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
[cvoisaf01->/osg1/home/infort1]
->
However, when the infort1 user tries to execute the on of the scripts, it is still asking for the password:
-> sudo /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh -c DISTCLUSTER -h /infinys/local/orl/HA
Password:
[cvoisaf01->/osg1/home/infort1]
->
Any ideas as to why this isn't working ??
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 06:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 06:17 AM
тАО11-25-2009 06:17 AM
Re: sudo NOPASSWD issue
Do you know how long I've looked at this command line and could't get see it...
Changed to a "," after each command and it worked....
Thanks
Changed to a "," after each command and it worked....
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 06:18 AM
тАО11-25-2009 06:18 AM
Re: sudo NOPASSWD issue
You're missing a comma "," between each allowed command.
Currently your sudoers definition file means that infort1 may run the stopCluster.ksh script, if and only if he specifies the full pathnames of other scripts as command-line arguments. If even one character is out of place in the "mandatory arguments", the command is denied.
This would be the corrected version:
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh, /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
Even better would be to use "\" to split the sudoers definition to multiple lines to make it more readable:
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
MK
Currently your sudoers definition file means that infort1 may run the stopCluster.ksh script, if and only if he specifies the full pathnames of other scripts as command-line arguments. If even one character is out of place in the "mandatory arguments", the command is denied.
This would be the corrected version:
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh, /infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh, /infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
Even better would be to use "\" to split the sudoers definition to multiple lines to make it more readable:
infort1 ALL=(ALL) NOPASSWD: /infinys/network/orl/working/APS/ClusterScripts/stopCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/startCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/manageClusterNode.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/cleanCluster.ksh, \
/infinys/network/orl/working/APS/ClusterScripts/checkCluster.ksh
MK
MK
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