Enabling sudo and persisting the sudoer’s list on FreeNAS

Fiddling with FreeNAS for a while now it was bothering me to have to su before running a command that requires root.

This sound simple but there is one caveat: If you just edit /usr/local/etc/sudoers, your changes will be lost when your box reboots.

FreeNAS stores some of its base files in /conf/base. To modify it you have to make it writable first, ssh into your box and run:

su
mount -uw /

Now you can nano /conf/base/etc/local/sudoers and add the following line:

%wheel ALL=(ALL) ALL

Make sure that the users that require sudo will be on the wheel group (you can change this from the web gui).

Reboot your FreeNAS and the system will apply this setting. That’s it!

More info on DistroGeeks, Karl Keppner and Sudo.ws.

Update 2013-10-26: Trying to apply this to FreeNAS 9.1.1 I noticed that the correct path to the persistent sudoers file is /conf/base/etc/local/sudoers.

sudo make me a sandwich

sandwich

I’ve been setting up a lot of Debian systems these days and sudo doesn’t come installed by default.Watch Full Movie Online Streaming Online and Download

Here is how you can get it up and running using apt-get:

 apt-get install sudo

After that, to add an already existing user to the sudoer’s list, just use usermod:

 usermod -a -G sudo USERNAME

Do not forget to use the -a option, otherwise the user is not going to be a part of the groups that he/she previously was.