Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 will be installing ubuntu server and since its all through terminal how do i connect to wifi?

what commands do i type in to connect and enter the passsword?


share|improve this question
up vote 4 down vote accepted

The configuration is all done through the /etc/network/interfaces file.

You need to have something like this in your /etc/network/interfaces file:

(this is for a WPA2 encrypted network)

auto wlan0

iface wlan0 inet dhcp
    wpa-driver wext
    wpa-ssid AccessPointName
    wpa-ap-scan 2
    wpa-proto RSN
    wpa-pairwise CCMP
    wpa-group CCMP
    wpa-key-mgmt WPA-PSK
    wpa-psk <your_hex_key>

Where <your_hex_key> is obtained by using:

# wpa_passphrase "Access Point Name" "WPA2 Pass Phrase"

You can change the network to use "static" instead of "dhcp" if you want to use a static IP address. You can then specify something like this:


in the main block of configuration.

share|improve this answer
the command auto didnt work for me for "auto wlan0" and iface didnt work as well. and i dont have /etc/network/interfaces its a fresh install of ubuntu-server do i need to connect to eth0 and download a bunch of files before going on wifi? – Sarmen B. Apr 10 '11 at 23:46
if /etc/network/interfaces doesn't exist then just create it. Auto and Iface aren't commands - they are configuration instructions you put into the /etc/network/interfaces file. – Majenko Apr 11 '11 at 8:35
wpa_passphrase is the only command you type at a terminal (hence the # prompt infront of it - # = root's prompt) – Majenko Apr 11 '11 at 8:36

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.