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.

I want to be able to connect to my WIFI(WPA) network from the command Line.I installed wpasupplicant from the repository and created two files. ONe a script and another a configuration file .

Bash script:

#!/bin/sh
iface=wlan0

#shut down interface
ifconfig $iface down

#set ad-hoc/management of wireless device
iwconfig $iface mode Managed

#enable interface
ifconfig $iface up

#stop any persistent wireless wpa2 sessions
killall wpa_supplicant

#apply WPA/WPA2 personal settings to device
wpa_supplicant -B -Dwext -i $iface -c ./wireless-wpa.conf -dd

#obtain an IP address
dhclient $iface

Conf File:

# config file using WPA/WPA2-PSK Personal key.

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="ssid"
scan_ssid=1
key_mgmt=WPA-PSK
psk="pass"
}

However I keep getting this error:

Initializing interface 'wlan0' conf './wireless-wpa.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file './wireless-wpa.conf' -> '/home/itsy/Desktop/./wireless-wpa.conf'
Reading configuration file '/home/itsy/Desktop/./wireless-wpa.conf'
Failed to read or parse configuration '/home/itsy/Desktop/./wireless-wpa.conf'.
Failed to add interface wlan0
Cancelling scan request
Cancelling authentication timeout

I have even tried substituting wpa_passphrase "myssid" , enter the pass and paste it into the conf file. It still does not work. Could someone please tell me what I am doing wrong?

share|improve this question

1 Answer 1

Apply WPA/WPA2 personal settings to device:

wpa_supplicant -B -Dwext -i $iface -c ./wireless-wpa.conf -dd

Also try apply WPA/WPA2 personal settings to device:

wpa_supplicant -B -Dwext -i $iface -c /etc/wireless-wpa.conf -dd

The directory listing could be off.

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.