Search the web with Google

Android install

Android installation weblog


Enter your email address:


Jeroen´s weblog

Ubuntu install

Ubuntu installation weblog


Monday, February 14, 2011

Fujitsu Siemens wireless / run script as root without sudo password

A friend of mine has a Fujitsu Siemens Amilo li 2727 laptop running Windows Vista.

I installed Ubuntu 10.4 LTS on this system, but alas, the wireless didn't work. This is the way I solved it:

Make a new textfile with these commands in it:

sudo modprobe -r ath5k
sudo modprobe acer_wmi
sudo modprobe ath5k 

I gave it the name wifi-on.sh

make it executable. (e.g. bij setting the rights with nautilus)


Enter ALT F2 and enter: gksu gedit /etc/sudoers  and press enter.

and in the file that opens, add to the very last line (replacing "username" with your login name):
-------------------------------------------------------------------
username ALL= NOPASSWD: scriptpath
-------------------------------------------------------------------
BE SURE TO REPLACE "username" WITH YOUR LOGIN NAME.
and replace scriptpath with the path to the file you want to run without a password.

for example, I want the script to run at startup as sudo without typing in the password. The last line in my file looks like:

jeroen ALL= NOPASSWD: /home/jeroen/wifi-on.sh

where "jeroen" is my user name and "/home/jeroen/wifi-on.sh" is the script i want to run.

now save the file and close it. you are now allowed to run your script as sudo without typing in a password.

so go to system > preferences > sessions and add the command you want to run at startup under "startup programs", mine looks like:
gksu /home/jeroen/wifi-on.js (replacing the path with the path to your script).

Reboot and configure your Wifi.
Reboot again and the machine should go online automatically. Even better than Windows Vista does.

No comments:

Post a Comment