Debian common users get root permissions | sudo installation and configuration
When a common user of the Debian system needs to install the software, he or she will often receive the "Permission denied" prompt. In this case, he or she needs the root Permission. So how can I have root permissions without logging on to the super Administrator account? For most Linux systems, we can use the "sudo" command to obtain root permissions, or log on to the super Administrator account using "su" to perform various operations that require root permissions.
However, the Debian system does not seem to have sudo installed by default, so the following describes how to install sudo and configure its sudoers file"
- Log on to the super Administrator Account, Enter the su and Enter keys in the Terminal command line, and Enter the super administrator password to Enter the root account.
- Enter the command apt-get install sudo, "Enter", and the system will start to install sudo (because sudo has been installed on my side, only the installed information will be prompted)
- Enter the adduser yl sudo command and press Enter.
This means to add my username yl To The sudo group. You can add your username to the sudo group based on the actual situation.
- Next, configure the sudoers file, which is written in the vi editor.
-Enter the command vi/etc/sudoers to enter the sudoers file;
-In vi command mode, enter/% sudo to search for % sudo ALL = (ALL: ALL) ALL, or manually locate
-In vi insertion mode (press the I Key), enter yl ALL = (ALL: ALL) ALL (same, here, yl represents my normal user name. You can modify it based on your needs)
-In vi command mode, enter x to exit vi and save the file.
- Verify that sudo is successfully installed
Restart Terminal, enter the command sudo ls, and then enter the user password. If the following words are displayed, the installation or configuration of sudo may fail. Repeat the preceding steps;
Yl is not in the sudoers file. This incident will be reported.
If the following words are displayed, The sudo installation and configuration are successful.
Desktop Documents Downloads Music Pictures Public Templates Videos
This article permanently updates the link address: