How to add sudo access on Ubuntu

青灯夜游
Release: 2019-03-15 17:19:10
Original
5702 people have browsed it

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.

How to add sudo access on Ubuntu

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
Copy after login

Testing sudo access

Run whoami using sudo command Command:

sudo whoami
Copy after login

Output:

root
Copy after login

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
Copy after login

Note: If it is the first time to use sudo, the system will prompt for input User password:

[sudo] password for username:
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!