3

I have tried creating a user through command line with sudo adduser user but when I log in using that user's credential I get some error saying user is not in sudoers file. How can I add new user to sudoers file?

4

How can I add new user to sudoers file?

If you wish to create a user with sudo privilege, execute,

sudo adduser --ingroup sudo <username>

If you wish to add an existing user, execute

sudo usermod -aG sudo <username>