Sudo Cheat Sheet: Difference between revisions

From Coolscript
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
*Allow vmadmin to exec something
*Allow vmadmin to exec something
  admin ALL=(ALL:ALL) ALL
  admin ALL=(ALL:ALL) ALL
*Consider to add in ssh config
AllowUsers admin .... or ansible@1.2.3.4

Revision as of 21:44, 16 February 2023

  • Edit
visudo /etc/sudoers
  • Ask for root password when exec sudo -i
Defaults rootpw
  • Add user to sudo group
usermod -aG sudo username
  • Allow apache to exec something
www-data ALL=NOPASSWD: /path/command
  • Allow vmadmin to exec something
admin ALL=(ALL:ALL) ALL


  • Consider to add in ssh config

AllowUsers admin .... or ansible@1.2.3.4