Software >> OS >> Unix >> Linux >> commands >> sudo >> How to have allow multiple commands without password and also commands with parameters

Example 1 of  /etc/sudoers

user1 ALL=NOPASSWD: /bin/su -,/bin/su -c [!-]*

 

=> user1 will not be prompted for password to run sudo su -

=> user1 will not be prompted for password to run sudo su - c "some shell command"

 

Example 2 of /etc/sudoers (allows all commands without password)

user1        ALL=(ALL)       NOPASSWD: ALL