I'm writing application where I need to scan one of wireless interfaces. In the past, my program was run with sudo
and I used (in code):
iwlist wlanX scan
But now I want to allow to run program without root privileges. Will it be relatively safe if I change capabilities of /sbin/iwlist
to cap_net_admin+eip
? Iwlist
is only for showing detailed wireless informations so broader access to this command probably is not very dangereous, right?
sudo iwlist wlanX scan
and configuresudo
to run the command without asking for a password?sudoers
file, right? If my application will be installed from deb on other computer how should I do this change (I don't know the name of user)?