Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'd like to connect to wireless network via command line in Linux. When doing it I've stuck with this issue:

 $ wpa_passphrase NETWORK_SSID NETWORK_PASSWORD
 Passphrase must be 8..63 characters

The NETWORK_PASSWORD has only five characters.

Via smartphone there is no problem with connection. Could you help me to solve this?

share|improve this question
1  
wpa_passphrase is not used to connect to a wlan. See linux.die.net/man/8/wpa_passphrase –  ott-- Jul 26 '13 at 17:11

2 Answers 2

up vote 2 down vote accepted

wpa_passphrase is used for generating keys for automatic WPA connections. If you want a manual one time from the command line setup use iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY

share|improve this answer
    
This ends with error `sudo iwconfig eth1 essid NETW_ID key PASSWD Error for wireless request "Set Encode" (8B2A) : invalid argument "PASSWD". –  xralf Jul 30 '13 at 17:18
    
eth1 is a strange designation for a wireless card. You should also be replacing "PASSWD" with your wireless access key/password. –  Tim Jul 30 '13 at 18:12
    
Yes it strange, but this is not a main problem. Naturally, I have there a password, but I'm not going to share it here. –  xralf Jul 30 '13 at 18:43
    
Ahh OK. Sometimes people just cut and paste my code, so I had to ask. Does iwconfig eth1 show that eth1 has wireless extensions? You can find answers to your error here: superuser.com/questions/42460/… –  Tim Jul 30 '13 at 19:28
    
This is really useful link, but don't see what is wrong. Here is iwconfig output. –  xralf Jul 30 '13 at 20:41

You cannot input less than 8 ASCII character as it is defined on 802.11 standard

What you can do is to use more than 8 ASCII character.

You can also see the protocol's implementation on the source code of the wpa_passphrase

if (os_strlen(passphrase) < 8 || os_strlen(passphrase) > 63) {
        printf("Passphrase must be 8..63 characters\n");
        return 1;
    }

Btw, wpa_passphrase is used to generate password phrase, not to connect a WLAN. And the passphrase is used on wpa_supplicant.conf which is a tool that I would recommend you to use, for more info click on[wpa_supplicant][1].

Alternatively you can use iw tool or the deprecated iwconfig. However, these two tools work for only WEP encryption that is phasing out (and of course open network (without encryption)). You can not connect to an AP that use WPA or WPA2 encryption

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.