How to run a binary without entering password even with sudo privilege - kdaisho/Blog GitHub Wiki
Running airmon-ng, airodump-ng, aireplay-ng, and aircrack-ng repeatedly gets frustrating when you're constantly prompted for your password—especially when juggling multiple terminal windows. This guide will show you how to remove that friction.
1. Identify the full paths to the binaries
Run this command to get the full paths:
which airmon-ng airodump-ng aireplay-ng aircrack-ng
It should output something like:
/usr/bin/airmon-ng
/usr/bin/airodump-ng
/usr/bin/aireplay-ng
/usr/bin/aircrack-ng
2. Create a sudoers file for no-password access
The general best practice is to use one rule per file (or at least group related rules logically).
Create a new file in /etc/sudoers.d/
, e.g.:
sudo visudo -f /etc/sudoers.d/aircrack_no_psd
Then add the following line (replace {username}
with your actual username)
{username} ALL=(ALL) NOPASSWD: /usr/bin/airmon-ng, /usr/bin/airodump-ng, /usr/bin/aireplay-ng, /usr/bin/aircrack-ng
3. Save and exit
sudo
without password
4. Test -- Use Now you can run:
sudo airmon-ng
...and it won't prompt you for a password.
⚠️ Note on security
Allowing no-password access to these tools means they can be run as root without authentication. This can be dangerous if your user account is ever compromised. Make sure your system is secure.