sudo: How do you grant sudo access and other notes?

To grant sudo access to a user, use visudo

http://stackoverflow.com/questions/11094826/how-to-give-a-linux-user-sudo-access

 

Why does #includedir start with a # when setting up a sudo environment?

Normally # would be used to create a comment. However, here they’re used to be more inline with C – i.e. to include files. E.g.

https://unix.stackexchange.com/questions/244064/why-are-the-include-and-includedir-directives-in-sudo-prefixed-with-the-pound

And in this directory an included file with:

<your username> ALL=(ALL) NOPASSWD:ALL

will mean you get sudo access.

 

Notes

  • your sudoers file may need to be 400 or 440
  • the format of the line are the details for access. i.e. which <user> <terminal> <users you want access as> <commands> so you might see this:
    • root ALL=(ALL) ALL
  • NOPASSWD: or NOPASSWD:<space> means don’t ask for a password

 

https://www.garron.me/en/linux/visudo-command-sudoers-file-sudo-default-editor.html

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *