The Debian system's ordinary users need to install software, often receive "Permission denied" prompt, this time requires root permissions. So how do you have root privileges without logging into the Super Admin account? For most Linux systems, we can use the "sudo" command to get root privileges, or "su" to log into the Super Administrator account to perform various operations that require root privileges.
However, the Debian system does not seem to install sudo by default, so the following explains "How to install sudo and configure its sudoers files"
- First login to the Super Administrator account, in the Terminal command line input su , "Enter" key, enter the Super Administrator password, that is, enter the root account
- After you enter the command apt-get install sudo, the "Enter" key, the system starts to install sudo (because I have sudo installed, so only the information that has been installed)
- Enter command adduser yl sudo, "enter" key
This means: add my username yl to the sudo group, and everyone will add their own username to the sudo group according to the actual name.
- The next step is to configure the sudoers file, which is written by the VI editor.
-Enter the command vi/etc/sudoers into the sudoers file;
-In the VI command mode, the input /%sudo Search is positioned to%sudo all = (All:all) All, or manually positioned
-In VI Insert mode (click the i key), under%sudo all = (all:all) all type yl all = (All:all) all (again, here yl represents my ordinary user name, everyone according to the actual repair Modified
-In VI command mode, enter : x to exit VI and save the file
- Verify that sudo is installed successfully
Restart the next terminal, enter the command sudo ls , and then enter the user password, if the following words are displayed, there may be sudo installation or configuration problems, need to repeat the above steps;
YL is not in the sudoers file. This incident would be reported.
sudo installation and configuration is successful if the following is displayed
Desktop Documents Downloads Music Pictures public Templates Videos
Debian ordinary users get root privileges |sudo installation and configuration