I need to run ifconfig wlan0 down
and ifconfig wlan0 up
with my common user.
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):
YOUR_USERNAME ALL=NOPASSWD:/sbin/ifconfig
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.
user YOUR_USERNAME=NOPASSWD:/sbin/ifconfig
is in my sudoers file, but I get bad permissions: SCIOCSIFFLAGS: Permission denied
. Do you have a ideia to solve this?
visudo
the changes won't take effect until you do.
sudo /sbin/ifconfig wlan0 down
after updating the sudoers file?
ifconfig up/down
? If you've just rebooted the interface has just been initialized anyway. I think we are still in XY problem territory :). Why do you want to execute this script?Is it just to get a fullscreen firefox?ifconfig
as a normal user.