Add user to list of sudoers

$ sudo visudo

Hit the “I” key, to switch the vi editor into INSERT mode
Add user “foo” to the list of sudoers, by adding a new line:

foo ALL=(ALL) ALL

Hit the “ESC” key, to leave the INSERT mode
Hit the “:” key, to switch to “COMMAND” mode

Enter “wq” at the prompt to save and exit – or –
Enter “qa!” at the prompt to exit without saving

:wq