Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using CentOS

uname -a
Linux mydomain.com 3.2.29-48.63.amzn1.x86_64 #1 SMP Sat Sep 15 01:43:12 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

I'm trying to add this command to my /etc/sudoers file using visudo ...

Cmnd_Alias     CHOWNCMD = /bin/chown jboss:jboss /usr/java/jboss/server/default/deploy/myclient*.ear

but when I try and save it is complaining about a syntax error. I can run this command (everything after the "=") on a command line, so I'm having a hard time figuring out what visudo is complaining about. Any suggestions how to modify the above line to get visudo to behave?

  • Dave
share|improve this question

1 Answer 1

up vote 5 down vote accepted

The colon is the syntax error. Try

Cmnd_Alias     CHOWNCMD = /bin/chown jboss\:jboss /usr/java/jboss/server/default/deploy/myclient*.ear

That validates for me (Fedora 16, sudo 1.8.3p1), and in addition it gives me the privilege to use under sudo.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.