Do this, assuming the standard WPA2 necured network:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Enter this text, replacing the details with yours (id_str
is just a comment, you can leave it as-is):
network={
ssid="TheGarNetwork"
psk="lollzthisisanexcellentpssword"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
id_str="Home_Wi-Fi"
}
CTRL-X, then press Y, then press Enter to save.
Next, type:
sudo nano /etc/network/interfaces
and add this to it:
allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.1.128
netmask 255.255.255.0
gateway 192.168.1.1
(
allow-hotplug
is optional, if you're likely to be unplugging and replugging the adapter, and don't want to have to manually reconnect.)
Fill in the IPs with the appropriate details, or (if you don't want to deal with that,) just replace the word "static" with "dhcp" and delete everything after it.
When you've got that done, reboot and see what happens!