When I try to use a usermod command to add me to the sudoers file but it says usermod: permission denied usermod: cannot lock /etc/passwd try again later. When I search things up it told me to add me to sudoers and I need to use usermod but I need usermod access which requires me to be in sudoers file to setup.
31 Answer
You'll need to use visudo to edit the sudoers file.
To access it, you'll need to be root. You'll also need to edit this file with visudo which in Ubuntu is linked to the nano editor.
$ visudo
visudo: /etc/sudoers: Permission denied
$ sudo su -
[sudo] password for your_current_user_name:
root@ # visudo visudo is used for safety sake to avoid making a mistake that could completely foul up your system.