14

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

18

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.