I have an embedded system with the root mounted as read only. I want to set up so my sudo users are able without a password change the setting (I plan to use the commands in the login and logout scripts for bash).

I am getting a syntax error on the line (see below) that defines a REMOUNT alias. I can't figure out what that syntax error is. Here is the snippet from the sudoers file

 # Cmnd alias specification
 REMOUNT = /bin/mount -o remount\,rw /,/bin/mount -o remount\,ro /
 # User privilege specification
 root    ALL=(ALL:ALL) ALL

 # Allow members of group sudo to execute any command

What am I doing wrong?

  • Is the keyword Cmnd_Alias missing just before REMOUNT? – Nicola Sarobba Feb 4 '16 at 7:59

You forgot to state that it is a command alias:

Cmnd_Alias REMOUNT = /bin/mount -o remount\,rw /,/bin/mount -o remount\,ro /
| improve this answer | |
  • Simultaneous posting as I figured out the answer for myself. Just deleted my answer and ticked yours. – akc42 Feb 4 '16 at 8:01
  • @akc42 apparently all three of us (including Nicola) figured it out at the same time. :D – muru Feb 4 '16 at 8:02

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.