Find All Sudo Users In CentOS linux
Find All Sudo Users In CentOS linux
As a linux administrator, sometimes you need to how many super users and normal users are there in a system. So you need to find all sudo users in a centos (linux) system.
However, there are chances that sometimes we need to give a temporary sudo access to a normal user to install a software or do certain administrative task on his/her own. Over time, we might forget to revoke the sudo access. So, it is good practice to know how many super users are in your system from time to time. If there are any forgotten or unwanted sudo access, you can simply revoke them.
# awk -F’:’ ‘{ print $1}’ /etc/passwd
This will list all the users who have sudo access.
To List all the user in a system
# compgen -u
Remove sudo privileges of an User
# sudo deluser <username> sudo