Centos 7 - 将用户添加到 sudoers 组 - 仍然不在 sudoers 文件中 - 为什么?

Why*_*Why 5 linux redhat user-management centos sudo

[user@localhost ~]$ su -
Password: 
Last login: ...
[root@localhost ~]# usermod -aG wheel user
[root@localhost ~]# exit
logout
[user@localhost ~]$ sudo echo 123
[sudo] password for user: 
user is not in the sudoers file.  This incident will be reported.
Run Code Online (Sandbox Code Playgroud)

我做错了什么?

Ed *_*erg 11

我的经验是“用户”需要注销并再次登录。尝试 'id' 命令,看看系统是否认为 'user' 在轮组中。