I have a user, say
userX on a Centos7 machine. I have removed all the groups from this user and this user is now assigned only to the group
userX. However, I am still able to use
sudo su and become
Sequence of commands:
SSH in as normal user
sudo su - userX.
3. Become root:
sudo su. This is allowed without password etc. The ideal behavior would be that
userX would not be allowed to become root.
sudo -lU userX:
[sudo] password for sriram: Matching Defaults entries for userX on this host: requiretty, !visiblepw, always_set_home, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin, timestamp_timeout=0 User userX may run the following commands on this host: (ALL) NOPASSWD: ALL (ALL) NOPASSWD: ALL
Where could I be going wrong? What additional information is required from me?