Home >Operation and Maintenance >Linux Operation and Maintenance >How to add sudo access on Ubuntu
The sudo command is designed to allow users to run programs with the security permissions of other users, which by default is the permissions of the root user. So how do you use sudo access on Ubuntu? The following article will introduce to you how to configure Sudo access permissions on an Ubuntu computer. I hope it will be helpful to you.
Configuring Sudo access
Just add the user (ex: xxsl) to the sudo group You can have Sudo access rights in
By default, on Ubuntu systems, members of the sudo group will be granted sudo access rights. To add a user to the sudo group, you need to use the usermod command:
usermod -aG sudo xxsl
Testing sudo access
Run whoami using sudo command Command:
sudo whoami
Output:
root
If the user has sudo access, the output of the whoami command will be root.
How to use sudo?
To use sudo, just add sudo and a space in front of the command, for example:
sudo ls -l /root
Note: If it is the first time to use sudo, the system will prompt for input User password:
[sudo] password for username:
The above is the entire content of this article, I hope it will be helpful to everyone's study. For more exciting content, you can pay attention to the relevant tutorial columns of the PHP Chinese website! ! !
The above is the detailed content of How to add sudo access on Ubuntu. For more information, please follow other related articles on the PHP Chinese website!