sudo allows ordinary users to temporarily gain root privileges and execute some commands.
Visudo Edit Profile configuration file /etc/sudoers
Core configuration root all= (all) all
Explanation:root is User name all user Source IP= ( all identity contains root) All commands are available
Configure your own WYP all= (root)/bin/ls
WYP can sudo ls/root view folders that should not have permissions
After the sudo command, the user enters their own password and can execute it. The user password is saved temporarily and can execute multiple sudo commands over a period of time without having to enter the user password again. You can modify the Save Password option in the configuration file.
Configure yourself Wyp all= (root) nopasswd: /bin/ls
User WYP does not need to enter a password when executing the sudo command
sudo-l View the current user, you can perform those sudo commands.
3.3-sudo detailed