A junior systems administrator is tasked with providing the network_administrators group the ability to perform sudo without prompting for a password. Which of the following steps should the administrator perform to accomplish this task? (Choose two.)
A. Use visudo to edit the /etc/sudoers file and add network_administrators to the "wheel" group
B. Use vi to edit the /etc/sudo file and add network_administrators to the "wheel" group
C. Provide all network_administrators with the "root" account password
D. Add the network_administrators ALL=(ALL) NOPASSWD: ALL directive to the /etc/sudoers file
E. Add the network_administrators=(ALL) NOEXEC: ALL directive to the /etc/sudoers file
Answer is A and D.
you can only configure the sudoers file using visudo
[root@centos7 ~]# sudo visudo
##
## This file must be edited with the ‘visudo’ command.
At the end of the /etc/sudoers file add this line:
1
username ALL=(ALL) NOPASSWD:ALL
Source:
https://phpraxis.wordpress.com/2016/09/27/enable-sudo-without-password-in-ubuntudebian/
Just for reference; You can edit the /etc/sudoers file using any text editor (vim/nano/emacs). However it’s recommended to edit it with visudo as visudo will perform error & syntax checking before saving your changes to the file.