I need to run ifconfig wlan0 down and ifconfig wlan0 up with my common user.
ifconfig wlan0 down
ifconfig wlan0 up
How can I perform this?
What you need to do is give your user the right to run ifconfig. The way to do this is to edit the etc/sudoers file:
Run sudo visudo
Add this line to the file (if you are using default settings and you are in vi, hit i to be able to edit the file, esc to exit editing mode and :wq to save and exit):
Obviously, change YOUR_USERNAME to your actual username.
That's it, your user can now run /sbin/ifconfig without requiring the root password. Your script should now be ready to run.
SCIOCSIFFLAGS: Permission denied
sudo /sbin/ifconfig wlan0 down
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3 years ago