Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to connect to a new network with Ubuntu 12.04 and fluxbox, and I'm not sure how to get it working. In the fluxbox menu there aren't any wlan-tools or network-manager, and since I'm not on the network I can't install any additional programs like wlan_radar.

Is there a terminal way to do network scans and connect with a WPA2 password?

share|improve this question
You can do it through the CLI, but it would be much easier for you to use wicd – RobotHumans Oct 22 '12 at 18:36

I'm not familiar with Ubuntu's Network Manager. You can always disable that using:

sudo service network-manager stop

Then use:

sudo iwlist wlan0 scanning | grep ESSID

To see if you can even see the network.

If so, and you're using wpa2, you'll have to do a few things. First generate the key/value pair that wpa_supplicant will use to connect:

sudo wpa_passphrase "mywireless_ssid" "secretpassphrase" >> /etc/wpa_supplicant.conf

Next, kill off any dhcp service (just in case it's running)

sudo pkill dhcpcd

Finally, try to connect:

wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf &

I would maybe not fork it to the background on the first attempt, just to see if it's going to work.

share|improve this answer
after sudo wpa_passphrase "mywireless_ssid" "secretpassphrase" >> /etc/wpa_supplicant.conf i got the error message: /etc/wpa_supplicant.conf: Permission denied (i did replace the essid and passphrase with the actual one) – StandardNerd Oct 22 '12 at 19:20
@Lennier: Yes, you can't redirect output from sudo like this. Try wpa_passphrase "mywireless_ssid" "secretpassphrase" | sudo tee -a /etc/wpa_supplicant.conf instead. – ire_and_curses Oct 22 '12 at 20:01
great, just one last question: i have a password with an exclamation mark (like "lorem_ipsum!") i could pass it with the backslash \ but in the generated file there is the backslash submitted, too. wpa_passphrase "mywireless_ssid" "secretpassphrase\!" | sudo tee -a /etc/wpa_supplicant.conf Is there any way to submit an exclamation mark without backslash? – StandardNerd Oct 22 '12 at 20:21
@Lennier - Change the double quotes to single quotes. – ire_and_curses Oct 22 '12 at 22:09

Your Answer


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.