# Sudoers File Location && Scripting Entries



## daBee (Apr 6, 2017)

I want to locate the `sudoers` file and script in an admin account.  Is this possible?  

The man page says /usr/local/etc/sudoers List of who can run what() but this 12.0 CURRENT indicates /usr/local/etc/ does not exist.  

I want to provide this for a user entry:


```
username5   ALL=(ALL) NOPASSWD: ALL
```

Is this possible?  `visudo` seems to go through a temp file.


----------



## SirDice (Apr 6, 2017)

A clean, freshly installed, system doesn't have a /usr/local/etc/ directory. Just create it, /usr/local/etc/sudoers is correct. Even a more modern /usr/local/etc/sudoers.d/ work. That one is better to use if you want to add entries automated. 



daBee said:


> `visudo` seems to go through a temp edit.


It's supposed to do that. It will only write the 'real' file when you save and close the file. This is to prevent accidental changes when two people try to modify the sudoers at the same time. It also does a syntax check before the actual update.


----------

