- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo: parse error in /etc/sudoers
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
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
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-14-2009 10:00 PM
тАО09-14-2009 10:00 PM
sudo: parse error in /etc/sudoers
Im trying to make a cmd alias in single sudoers file for HP-UX, solaris, Aix and Linux servers.
But im getting "sudo: parse error in /etc/sudoers" error for a cmd of Linux and Aix,
Linux:--
/bin/rpm -qa --queryformat %{NAME}:%{VERSION}\\n 2>/dev/null,\
Aix:--
/usr/sysv/bin/df -lv | grep -vi filesystem | grep -i '\/dev\/' | awk{'print $2'} 2>/dev/null
Please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 10:17 PM
тАО09-14-2009 10:17 PM
Re: sudo: parse error in /etc/sudoers
Try running the command manually, then put it into sudoers file . If the command is not successful the parse error is obvious.
It looks in the last line "grep -i '\/dev\/' : may be having problem, Try running the command from command prompt. Is it going through.
hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 10:19 PM
тАО09-14-2009 10:19 PM
Re: sudo: parse error in /etc/sudoers
awk{'print $2'} # wrong.
should be :
awk '{print $2}'
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 10:24 PM
тАО09-14-2009 10:24 PM
Re: sudo: parse error in /etc/sudoers
>>But im getting "sudo: parse error in /etc/sudoers" error for a cmd of Linux and Aix,
Post your error messages for Linux and AIX.
for aix server your grep and awk statement are wrongly placed.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 11:42 PM
тАО09-14-2009 11:42 PM
Re: sudo: parse error in /etc/sudoers
Im rectify awk error but still error is coming
AIX:--
/usr/sysv/bin/df -lv|grep -vi filesystem|grep -i '\/dev\/' | awk '{print $2}' 2>/dev/null
error:--
>>> /etc/sudoers: syntax error near line 61 <<<
sudo: parse error in /etc/sudoers near line 61
sudo: no valid sudoers sources found, quitting
For Linux:--
/bin/rpm -qa --queryformat %{NAME}:%{VERSION}\\n 2>/dev/null
error:-
>>> sudoers file: syntax error, line 102 <<<
sudo: parse error in /etc/sudoers near line 102
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 11:45 PM
тАО09-14-2009 11:45 PM
Re: sudo: parse error in /etc/sudoers
For linux
Cmnd_Alias DISCOVERY=/bin/uname -s,/bin/uname -a,/usr/bin/nslookup `hostname` 2>/dev/null,\
/usr/bin/hostid 2>/dev/null,/sbin/ifconfig -a>/dev/null,\
/sbin/fdisk -l 2>/dev/null,/bin/df -TPl -x tmpfs 2>/dev/null,\
/usr/sbin/dmidecode 2>/dev/null,/sbin/fdisk -l 2>/dev/null,/bin/df -TPl -x tmpfs 2>/dev/null,\
/bin/cat /etc/sysconfig/hwconf 2>/dev/null,/bin/cat /proc/cpuinfo 2>/dev/null,\
/bin/rpm -qa --queryformat %{NAME}:%{VERSION}\\n 2>/dev/null,/usr/sbin/dmidecode,\
/bin/cat /proc/meminfo 2>/dev/null
For Aix:--
Cmnd_Alias D1=/usr/sysv/bin/df -lv|grep -vi filesystem|grep -i '\/dev\/' | awk '{print $2}' 2>/dev/null
Both cmd working from prompt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2009 11:01 PM
тАО09-27-2009 11:01 PM
Re: sudo: parse error in /etc/sudoers
thanks