Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to add Defaults!PFIFGW !log_allowed to sudoers returns an error #63

Open
alexwmaustin opened this issue Apr 17, 2024 · 0 comments

Comments

@alexwmaustin
Copy link

In the config it asks that you run the command printf 'Defaults!PFIFGW !log_allowed\n' | sudo tee -a /usr/local/etc/sudoers > /dev/null. This however, always returned an error for me PFIFGW: Event not found.

I found that the only way to rectify it was to manually add Defaults!PFIFGW !log_allowed To the sudoers file.

The following needs some extra care, messing with the sudoers file can potentially not go well. Fixing this will just prevent the sudo logs from appearing in the opnsense logging at System > Log Files > General. The solution is as follows.

  1. open a root ssh terminal to your opnsense instance
  2. Using the command visudo open the sudoers file
    • Its critical you only use visudo to prevent messing with the sudoers file incorrectly
  3. Scroll to the bottom using the arrow keys, if you ran the previous commands from the configuration instructions you should see telegraf ALL=(root) NOPASSWD: /usr/local/bin/telegraf_pfifgw.php and Cmnd_Alias PFIFGW = /usr/local/bin/telegraf_pfifgw.php at the bottom
  4. Press the I key to enter Insert mode
  5. Carefully type out the Defaults!PFIFGW !log_allowed line, copy paste will not work don't try
  6. Press Esc Key to enter command mode
  7. Type :wq to save and quit the file
  8. you can run sudo visudo -c after to ensure it will work

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant