Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I set a system wide wireless WPA password that starts at boot time, allowing me to SSH in to the machine from outside, for example?

I'm running mythbuntu. Until I log in, WiFi doesn't connect, so I can't use SSH to log in from another computer, for example. When I have auto-login enabled, it asks me to enter my password to unlock my keyring before connecting. I've tried editing the connection and clicking "Available to all users", but then it just doesn't connect at all.

How do I go about debugging this problem, or how can I configure it totally manually?

share|improve this question
1  
Did you enable the "Connect automatically" checkbox for the connection? –  Li Lo Aug 5 '10 at 23:08
    
This has good answers. I think we should reopen it. –  Seth Oct 14 '13 at 21:11

4 Answers 4

for "regardless of being logged in," you'll need to edit your /etc/network/interfaces file...

http://ubuntuforums.org/showthread.php?t=263136

That link describes the process pretty well...

iface wlan0 inet static
  address 192.168.1.15
  netmask 255.255.255.0
  wireless-essid my_essid
  gateway 192.168.1.1
  pre-up wpa_supplicant -Bw -Dwext -i$IFACE -c/etc/wpa_supplicant.conf
  post-down killall -q wpa_supplicant
share|improve this answer
    
<pre> oh, regardless of being logged in... You'll need to edit your /etc/network/interfaces file... ubuntuforums.org/showthread.php?t=263136 That link describes the process pretty well... iface wlan0 inet static address 192.168.1.15 netmask 255.255.255.0 wireless-essid my_essid gateway 192.168.1.1 pre-up wpa_supplicant -Bw -Dwext -i$IFACE -c/etc/wpa_supplicant.conf post-down killall -q wpa_supplicant </pre> –  cjac Aug 6 '10 at 0:23
    
When I make this, after I restart my ubuntu, and appear Booting system without full network configuration –  Vitor Mazuco Apr 5 at 12:39

When you are logged in and connected to the network, right-click the Network Manager icon. (It should be in the upper right of the screen.)

Click "Edit Connections..."

Find the connection you want to make available without login. Click it and click the "Edit" button.

Make sure the "Connect automatically" and "Available to all users" boxes are checked.

Now the connection will start up before anyone logs in and will be available to everyone on the system.

share|improve this answer
    
My suspicion is the "Connect automatically" box has been cleared... that would cause the behavior you are seeing. –  fader Aug 6 '10 at 14:49
    
If I do this, without checking "Available to all users" it does not work, even when I log in –  shodanex Oct 13 '10 at 9:40

For the sake of completeness, I'll also mention wicd, an alternative to Network Manager. I believe that if you configure wicd to connect automatically to a wireless network, it will happily do so at boot time.

share|improve this answer

Use wpa_ supplicant and dhclient

You will have to create a script that starts up at boot-time have a look here.

Have it run the following 3 commands (possibly from a script og sorts)

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sleep 10
dhclient wlan0

The contents of the wpa_supplicant.conf file should look something like this (using standard wpa-psk):

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
network={
    ssid="network-essid"
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="very secret passphrase"
}

look at the man page for wpa_supplicant.conf for more encryption options.

You might need to tweak the sleep command depending on how fast your router/netcard is at negotiating the connection. 10 seconds should be enough, but 5 or even 2 may be enough.

share|improve this answer

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.