Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using bluetooth on linux to access internet via dialup from my Nokia S60 phone. I've gotten the connection to work just fine, but there's still one recurring problem:

Some Nokia S60 phones, mine included, have the habit of changing the channel they offer their Dial-Up Networking service on. One day it's 2, the next day it may be switched to 9. For linux, this means that each time it happens I have to go edit the /etc/bluetooth/rfcomm.conf to contain the right channel and then use "/etc/init.d/bluetooth restart" to reboot the bluetooth service.

I've created a script to do all this for me, and granted edit rights to the rfcomm.conf - but restarting the bluetooth service still needs super-user rights. I'd rather not have to type my password every time the phone feels a need to juggle channels, so:

How do I grant the user access to restart the bluetooth service? Preferably without breaking too much of my access control - so granting the user full root-level access is not a solution. :)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Add

Cmnd_Alias BT=/etc/init.d/bluetooth
username ALL=NOPASSWD: BT

to your /etc/sudoers file. Don't forget to change username though :)

This will allow you to run sudo /etc/init.d/bluetooth restart without entering the password but sudo will still ask for it when you run it with any other application.

share|improve this answer
    
Perfect! Thanks! –  Ilari Kajaste Sep 11 '09 at 14:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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