Adding your user to the sudoers file on Debian.

If you want to be able to use the sudo command in Debian to do superuser tasks as your normal user, then you need to edit the /etc/sudoers file to look like this. Use the visudo command to do the editing of the /etc/sudoers file, this will make sure the file is properly edited without errors before it is saved. in this example on Debian 6.0 I am using the username lovecraft and I have added myself to the /etc/sudoers file to be able to use sudo but still requiring to system to ask me for a password.

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults	env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root	ALL=(ALL) ALL
lovecraft ALL=(ALL) ALL

# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d

The members of the group sudo can execute commands as root, and I could have added my user to this group, but I preferred to do it this way. using sudo requires you to have a very strong password on your normal user account as well as your root account unless you disable it with this command: sudo passwd -l root. This is how Ubuntu is set up, the root account is disabled and the sudo command is used to do superuser tasks. But you can set a password for the root account on Ubuntu by typing sudo passwd root.

No comments have been made. Use this form to start the conversation :)

Leave a Reply