After logging into ssh, I got this message:
'Username' is not in the sudoers file. This incident will be reported.
How can I resolve this? I'm connecting ssh to my virtual private server.
The error message looks like this: $ sudo -i [sudo] password for linuxconfig: linuxconfig is not in the sudoers file. This incident will be reported. In order to fix the error, all we need to do is add our user to the correct group.
The issue is caused by your user not having sudo access in your system and can be quickly fixed by adding the user to the wheel group using the usermod command or via editing the sudoers file in your Linux system.
The result can be an impaired instance that can't run sudo su or commands that require privileged user access. To fix this syntax error, stop the instance, detach its root volume, attach it to a recovery instance, mount the root volume as a secondary volume, and then revert the changes to the sudoers file.
Open file
sudo nano /etc/sudoers
Then add the user below admin user like below syntax.
user_name ALL=(ALL) ALL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With