Sudo in Debian 10 is driving me mad. I have a clean, vanilla install of Debian 10. During installation, I've set a root password as well as created a normal user, let's name him "tom".
Logged in as Tom, I open a terminal and try to add tom to sudo:
su [entering root password] whoami [root] /usr/sbin/usermod -a -G sudo tom
No errors, all seems well. Testing it:
su tom whoami [tom] sudo echo "hello"; [hello]
Works as expected. Next, I close the terminal. Still logged in as Tom in this desktop session, I open a new terminal:
sudo echo "hello"; [error: tom is not sudoers file]
The sudo add is not persisted, as soon as I close a terminal, it's gone. I can confirm this with the "groups" command. After the above sequence of commands, it successfully lists "tom" as part of the sudo group. After closing the terminal and opening a new terminal, "groups" shows "tom" as not part of the sudo group.
Why is my change not persisted?
(on a probably unrelated note, I'm unable to visually log into the system using my root account, despite knowing sure the password is correct).