Loading Debian (Ubilinux) on the Edison

Pages
Contributors: Shawn Hymel
Favorited Favorite 5

Bonus: Adding "sudo"

This part is completely optional. Some people like to use the "sudo" command in order to execute actions that require superuser privileges (such as "sudo apt-get install"). Others prefer to switch users with "su" to execute commands. It is an ongoing debate.

If you would like to add the sudo command, we first need to install it. With the root account, run the command:

apt-get install sudo

Add your user account (not root!) to the sudo group:

adduser <YOUR_USERNAME> sudo

Logout with the "logout" command (you might have to type it twice if you are using "su"):

logout

Log back in with your regular user account. Try a command such as:

ifconfig

You should get an error like "-bash: ifconfig: command not found." Try the same command again with "sudo" in front:

sudo ifconfig

You should get a print out of your network status.

Testing sudo in Ubilinux

You can now use sudo to run commands that require administrative privileges without having to log in to your root account. It lowers security some by allowing a regular user to run commands with escalated privileges. However, it means that you do not need to sign into your root account if you are using something like SSH.

Ideally, you would figure out which commands your user account would need to run and enable only those in the sudoers file. This can be done with the "visudo" command. To learn more about how to edit the sudoers file, read this article.