After Debian is installed, sudo cannot be used.
If sudo is not installed, run apt-Get install sudo under the root user.
Set sudoers configuration file in Root
Chmod + w/etc/sudoers
Vim/etc/sudoers
Add username all = (all) All
Here, username is your user name. Save
Change sudoers file permissions chmod 0440/etc/sudoers
Exit Root
From: http://blog.chinaunix.net/u1/51074/showart_429833.html
Method 2: 7. Add the user you created during installation to sudoers
Mongodo
Add
% ADM all = (all) All
Then run gpasswd-a username Adm
It is a post, turn from: http://www.linux-wiki.cn/index.php/%E6%B7%BB%E5%8A%A0sudoer
UseSudoYou can temporarily obtain the root permission when logging on to a non-root user and execute the required command.
Sudo users can be called sudoer.
Add sudoer (assuming you have installed SUDO ):
Run
# Mongodo
Or
# Sudoedit
Tip:
Some release versions of sudo provide sudoedit, while others provide mongodo, which are basically the same function. You can also use other editors such as VI for editing./Etc/sudoers, But because the file is read-only, please force save (such as W !) Or remove the read-only attribute and save it.
Search
Root all = (all) All
Add
% ADM all = (all) All
If you do not want to enter the password during sudo, you can change the above sentence:
% ADM all = (all) nopasswd: All
Save the file and then execute
# Gpasswd-a username Adm
Then the user can use sudo.
for daily use security, it is very important not to use the root account unless necessary. It can be replaced by sudo. In this way, not only do all the configuration files belong to the current user, the root directory is the same, but recently we found that there is also a small problem with sudo. We all know that the automatic completion function of the tab key in Linux is very powerful, but I found that after sudo is used, the tab key becomes silly. In addition to completing the path, the command has no effect, but now you know the reason.
set it in the. bashrc file.
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in/etc/bash. bashrc and/etc/profiles
# sources/etc/bash. bashrc ).
# If [-F/etc/bash_completion]; then
#. /etc/bash_completion
# fi
This is the last few lines. Remove the # At the beginning of the last three lines and log on again to pull the lines.
post from: http://www.i170.com/Article/48420