To check the current users who have sudo privileges, you can look at the /etc/sudoers file or check the members of the sudo group. Here are two methods:
Method 1: Check the sudo group
You can list the members of the sudo group with the following command:
getent group sudo
This will display the users who are part of the sudo group.
Method 2: View the sudoers file
You can also view the /etc/sudoers file, but it's recommended to use visudo to avoid syntax errors:
sudo visudo
This will open the sudoers file in a safe editor. Look for lines that grant sudo access to users or groups.
Note:
Be cautious when editing the sudoers file, as incorrect configurations can lead to loss of sudo access.
