11

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.

1 Answer 1

15

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .