When this happened to me all I had to do to fix it was:
Step 1. Open a terminal window, CTRL+ALT+T
on my system (Debian KDE after setting up as hotkey)
Step 2. Entered root using command
Step 3. Input root password
Step 4. Input command
apt-get install sudo -y to install
Step 5. Add user to sudoers file by inputting
adduser username sudo, put your username in place of
Step 6. Set the correct permissions for sudoers file by inputting
chmod 0440 /etc/sudoers
Step 7. Type
exit and hit Enter until you close your terminal window. Shutdown your system completely and reboot.
Step 8. Open another terminal window.
Step 9. Try any sudo command to check if your username is correctly added to sudoers file. I used
sudo echo "Hello World!". If your username has been correctly added to the sudoers list then you will get
Hello World! as the terminal response!
Follow the link to reset your admin password [sounds like you named your admin user account as
After that, login as the admin user and execute the following.
sudo usermod -aG sudo,adm fsolano
Now you can login as
fsolano and you should be able to run
If you get
bash: usermod: command not found even as root, try:
/sbin/usermod -aG sudo,adm fsolano
I am having the same issue with Kali anytime I want to add newuser to the sudo group by typing this command:
usermod -aG sudo newuser
and editing the right section in
My fix for this nonsense is to copy the line for root below it and changing root to newuser:
# User privilege specification root ALL=(ALL:ALL) ALL newuser ALL=(ALL:ALL) ALL
I remember the usual method with usermod used to work but is it a bug for the last couple of years now?
it’s really nonsense.
anyway, if someone has a better answer, share it please:)