23

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?

4
  • 1
    Did you enable the "Connect automatically" checkbox for the connection?
    – Li Lo
    Aug 5, 2010 at 23:08
  • This has good answers. I think we should reopen it.
    – Seth
    Oct 14, 2013 at 21:11
  • Key words: user being logged in" - so this won't help me. WiFi is the only connection to this computer, using a parabolic dish because of distance. It is on a UPS. But if all fails and it ends up rebooting, I have to travel to it to log in on the console before it will communicate.
    – SDsolar
    Jul 16, 2017 at 9:53
  • Of course, I just noticed this was posted 6 years 11 months ago. Hello from the future: July 2017.
    – SDsolar
    Jul 16, 2017 at 9:55

6 Answers 6

14

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.

2
  • My suspicion is the "Connect automatically" box has been cleared... that would cause the behavior you are seeing.
    – fader
    Aug 6, 2010 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, 2010 at 9:40
7

An easier solution: add the following lines to /etc/network/interfaces

auto wlp1s0
iface wlp1s0 inet dhcp
  wpa-essid wifiName
  wpa-psk Password

I have tested it on 16.04 LTS. May work on other versions.

Source: https://ubuntuforums.org/showthread.php?t=1963404

6

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
2
  • <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, 2010 at 0:23
  • When I make this, after I restart my ubuntu, and appear Booting system without full network configuration Apr 5, 2014 at 12:39
2

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.

1

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.

0

I have tried using the /interfaces or /interfaces.d/ to get to wireless with dhcp with wpa_supplicant but these did not work. But the only option that worked for me was, Adding the lines physically in /etc/rc.local

#!/bin/bash
sudo wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &
sleep 10
sudo dhclient -v
exit 0
~   

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .