I need to add an entry to the sudoers file to allow the user to run a specific command. So it happens the command includes a colon " : "

mount -t nfs -o vers=4 host:/remoteMountpoint /home/username/localMountpoint

Visudo complains the entry is not valid, doesn't allow me to save it. I mean I could try and force it but I am afraid of the consequences. One obvious workaround is to use a wildcard " * " in place of the colon, but I wonder if there's another (proper) way to do it.


From the sudoers man page:

Note that the following characters must be escaped with a ‘\’ if they are used in command arguments: ,, :, =, \.

mount -t nfs -o vers=4 host\:/remoteMountpoint /home/username/localMountpoint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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