su; # become super user
adduser  sudo; # add username to the group sudo 

The change will take effect the next time the user logs in.

This works because /etc/sudoers is pre-configured to grant permissions to all members of this group (You should not have to make any changes to this):

# Allow members of group sudo to execute any command

vim /etc/sudoers; # open up config

# add the orange line for username "user"
# User privilege specification
root    ALL=(ALL:ALL) ALL
user    ALL=(ALL:ALL) ALL

:wq! # save and quit in vim
reboot; # reboot system


if you get strange error „can’t resolve hostname“:

Two things to check (assuming your machine is called


, you can change this as appropriate):

  1. That the

    file contains just the name of the machine.

  2. That

    has an entry for


    . It should have something like:    localhost.localdomain localhost    my-machine

If either of these files aren’t correct (since you can’t sudo), you may have to reboot the machine into recovery mode and make the modifications, then reboot to your usual environment.