Allow passwordless sudo on your admin account
As this account could be used for automation purposes, it would defeat the purpose if you had to enter a password after every command, thus we will allow your non-root user to run commands as the root user without entering a password.
Instructions:
- Login to your VM as your non-root user.
- Edit the Sudoers file by running the following command;
sudo visudo -f /etc/sudoers
- Comment the following line - ‘%wheel ALL=(ALL) ALL’
- Uncomment the following line - ‘#%wheel ALL=(ALL) NOPASSWD: ALL’
- Save and close the file.
- Test that you can sudo to root without a password, by entering ‘sudo -i’
- Type exit to log out as the root user.