sudo in .bashrc

Due to a quirk with the Raspberry Pi's current implementation of Debian I had some trouble mounting CIFS shares at start up. The solution was to run the mount command once logged in, the easiest way to do this is in the .bashrc script.

However! To run the mount -a command to mount all shares requires elevated privileges but I didn't want to have to type password twice at login. The solution to this is add the command itself to the /etc/sudoers with the NOPASSWD flag:

pi    ALL=(ALL)    NOPASSWD: /bin/mount

One thing to note is that it's important to provide the full path to the command.