I would like to define a keyboard shortcut that resets my wireless adapter. I know it is possible in the terminal with sudo ifconfig, but for the keyboard shortcut, I can't provide the password for sudo.

Are there other commands that can do the job without root privileges?

  • the password for sudo is the one you use to log in – SimplySimon Jul 28 '13 at 13:14

Network Manager has a nice CLI tool, nmcli, that does not require root privilege. You can reset wifi with

nmcli radio wifi off && nmcli radio wifi on
wifi off
wifi on 

seems to do the job. I wanted also to splash some text to the foreground but it's not so important. Any ideas about how to do that?


No they are not, but you can call gksudo instead of sudo to have a window showed up that asks for your password.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.