I have a difficult problem to understand and cannot find any solution on google as well. My system is CentOS 7
I am trying to add a user, let's say UserA to a sudo group. First, I tried "usermod -a -G wheel" without any effect, even though the group "wheel" in "/etc/sudoers" is not commented. I then found that there are files inside "/etc/sudoers.d/", etc. "local_sudoers". This file contains those lines:
Code: Select all
User_Alias LOCAL_ADMINS = user1,user2
LOCAL_ADMINS ALL = ALL
When I edited this file using visudo: "visudo -f /etc/sudoers.d/local_sudoers", and added the account UserA to the group, finally the UserA was able to run sudo. However, the file gets reset to its previous version, which is the one without the UserA when i restart system. Consequently after restart UserA cannot Is there any place in CentOS that causes overwriting this file which I should edit?