![]() If you find yourself creating lots of these sudoers.d files then perhaps you will want to create them named per user so they are easier to visualize. You can run sudo -l to see the permissions that your user has been granted, if any of the user specific NOPASSWD commands appear BEFORE any %groupyouarein ALL=(ALL) ALL command in the output you will be prompted for your password. Then save and exit and visudo will warn you if you have any syntax errors. Sudo visudo -f /etc/sudoers.d/mynotriskycommand You should NEVER grant NOPASSWD on ALL commands. You should also always use visudo to edit the file(s). Ideally if you are customizing what commands can be run via sudo you should be making these changes in a separate file under /etc/sudoers.d/ instead of editing the sudoers file directly. # See sudoers(5) for more information on "#include" directives: # Allow members of group sudo to execute any command # Members of the admin group may gain root privileges # See the man page for details on how to write a sudoers file.ĭefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Please consider adding local content in /etc/sudoers.d/ instead of # This file MUST be edited with the 'visudo' command as root. More importantly, what do I need to do so that I can run sudo mkdir /etc/blah as my current user ( myuser) without being asked for the password? Please note that when I run ls -ltr / I get: drwxr-xr-x 94 root root 4096 Jul 30 13:28 etcīut I don't think this matters because I've set myself up as a "sudoer", right? I do not want to be asked for my password when doing this operation. ![]() I SSHed into my machine, added the following line to /etc/sudoers: myuser ALL=NOPASSWD: ALLĪnd then tried running: sudo mkdir /etc/blah
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |