Blog Forum Wiki Links Contact Us NetbookUser

You are not logged in.

#1 2007-11-07 5:11:21 pm

Cmiller82
Member
Registered: 2007-11-07
Posts: 12

WPA keys with spaces work around

This is a work around, bordering on a fix.

There are two files that need modification for it to work.

/etc/network/if-pre-up.d/0001xandros-wireless-tools
/usr/sbin/xandros-wpa-config

Basically the reason spaces don't work in WPA keys is some programming errors in the scripts that process the key.

These changes should only be performed if you are comfortable messing with system files.  Making a mistake, or deleting these files will prevent your wireless connections from working.

Download the files here: http://www.chrisandmaya.com/eee/wpa_space_fix.tar.gz

Put the files into their directories noted above.

Now... if you use the tray icon to setup the wireless it should work fine.  BUT if you go to the Network Connections and click properties, it will NOT allow you to enter a key with spaces.  No big deal... just take the spaces out if you need to change other options in there, and then you can put the spaces back in manually in /etc/network/interfaces, under wireless-key
Make sure you keep the " s: " in front of the key,

If anyone has any questions, post them here and I'll try to answer them as best I can.

Good luck.

Last edited by Cmiller82 (2008-06-12 5:16:47 pm)

Offline

 

#2 2007-11-07 7:36:49 pm

mkrishnan
Moderator
From: Grand Rapids, MI, USA
Registered: 2007-11-06
Posts: 3444

Re: WPA keys with spaces work around

Is there an analogous issue if the SSID / text name of the network has spaces in it, or is it only if the passcode has spaces?


Mohan

Offline

 

#3 2007-11-07 8:20:32 pm

Cmiller82
Member
Registered: 2007-11-07
Posts: 12

Re: WPA keys with spaces work around

There does not seem to be an issue with SSID's having spaces in them.

Offline

 

#4 2007-11-07 8:45:46 pm

mkrishnan
Moderator
From: Grand Rapids, MI, USA
Registered: 2007-11-06
Posts: 3444

Re: WPA keys with spaces work around

Thanks for the response! smile

And glad I don't have to change mine then! yikes


Mohan

Offline

 

#5 2007-11-29 7:14:00 am

christianredhat
New member
Registered: 2007-11-29
Posts: 1

Re: WPA keys with spaces work around

hiya, i have tried this but the permissions will not allow it do I have do su root and so on?

Offline

 

#6 2007-11-29 10:37:47 am

Cmiller82
Member
Registered: 2007-11-07
Posts: 12

Re: WPA keys with spaces work around

You must be root to change the files.

Type: "sudo bash" to give yourself a root shell... be careful!

you can also just type "sudo" in front of the copy commands

Here is a quick walk through:

1. Download the tar file with the browser
2. Open a shell (ctrl-alt- T )
3. Find the directory the file was downloaded to
4. Type:  tar zxvf wpa_space_fix.tar.gz
5. Type:  cd wpa_space_fix
6. Type:  sudo cp 0001xandros-wireless-tools /etc/network/if-pre-up.d/
7. Type:  sudo cp xandros-wpa-config /usr/sbin/

Then add the network by going using the Wireless Network tool.

Hope this helps, good luck.

Offline

 

#7 2007-12-12 6:55:30 am

ben_v_johnson
New member
Registered: 2007-12-12
Posts: 1

Re: WPA keys with spaces work around

Hi Cmiller82

Thanks so much for the fix.  It resolved my connection issues.  I can verify that this resolves issues with WPA2 AES keys with spaces in them.

Ben

Offline

 

#8 2008-01-07 9:43:18 pm

jimh
New member
Registered: 2008-01-07
Posts: 1

Re: WPA keys with spaces work around

I tried to do this, and now my eee connects to my neighbors unencrypted access point.

Offline

 

#9 2008-01-09 4:16:50 pm

kchester
Member
Registered: 2007-12-27
Posts: 24

Re: WPA keys with spaces work around

This did not work for me. I did everything in post #6, and then even tried to insert my code in /etc/network/interfaces. I've added quotes around the code, replaced spaces with underscores, converted my code to hexidecimal, etc. Nothing. Is there somethingI could be doing wrong or another possible fix? I can't change the code of the WPA network I'm on as I'm one of thirty people using it. Pointless to change it for one computer.

Offline

 

#10 2008-01-09 4:39:54 pm

kchester
Member
Registered: 2007-12-27
Posts: 24

Re: WPA keys with spaces work around

Scratch that. It suddenly started working and I haven't the faintest clue why....

Offline

 

#11 2008-01-25 4:57:21 pm

JmH
New member
Registered: 2008-01-25
Posts: 1

Re: WPA keys with spaces work around

Cmiller82 -

Thanks so much for your fix. It works like a charm!

   <*> Jim

Offline

 

#12 2008-02-27 7:51:30 am

Wandalf
New member
Registered: 2008-02-27
Posts: 2

Re: WPA keys with spaces work around

Hi all

I just got my Eee 4G (finally) and I'm very happy with it. works without a glitch, with the exception of the WiFi network at work.
That one uses WPA encryption with a pass phrase that contains spaces.

Now I've tried everything listed here, but I can't get it to connect properly. Any tricks or tips on things I might have forgotten?

Thanks

Offline

 

#13 2008-02-27 5:13:02 pm

Cmiller82
Member
Registered: 2007-11-07
Posts: 12

Re: WPA keys with spaces work around

Try to connect and then paste the output form the details window.

Chris.

Offline

 

#14 2008-02-28 12:15:25 am

vince
Senior Member
Registered: 2008-02-15
Posts: 140

Re: WPA keys with spaces work around

the procedure at the top of this thread worked for me.  In a different thread (search for my posts), I posted the pertinent files from my system that resulted if you want to also copy them into place and lightly edit them to replace my bogus essid and psk strings with whatever reflects your network.


"The Precious" - Black 1000HE, OCZ 2GB, Zagg Invisible Shield, Win7 Home Premium

Offline

 

#15 2008-03-06 10:40:36 am

UnexpectedGreg
New member
Registered: 2008-03-06
Posts: 1

Re: WPA keys with spaces work around

Hello. I'm also having problems. Cmiller82, post #6 doesn't seem very clear what to do. Can you provide a screen shot of what you would type because I have tryed but very un successful.

Thanks,

UnexpectedGreg

Offline

 

#16 2008-03-10 8:20:02 pm

laichzeit
Member
Registered: 2008-03-04
Posts: 80

Re: WPA keys with spaces work around

I now have a splitting headache AGAIN after running through all of those instructions for the madwifi and receiving the following when trying to connect:

"Configuring interface ath0=lan2 (inet)
run-parts --verbose /etc/network/if-pre-up.d
Starting WEP wireless connection...
/etc/wpa_supplicant/functions.sh: line 761: unexpected EOF while looking for matching `''
/etc/wpa_supplicant/functions.sh: line 833: syntax error: unexpected end of file
ifconfig $IFACE up
dhclient3 -cf /etc/dhcp3/dhclient.$LOGICAL.conf -pf /var/run/dhclient.$IFACE.pid -lf /var/run/dhclient.$IFACE.leases $IFACE
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wifi0: unknown hardware address type 801
Setting lan1 interface eth0 metric to 10
wifi0: unknown hardware address type 801
Listening on LPF/ath0/00:15:af:4d:38:c6
Sending on   LPF/ath0/00:15:af:4d:38:c6
Sending on   Socket/fallback
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 8
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
Setting lan1 interface eth0 metric to 10
run-parts --verbose /etc/network/if-up.d
/etc/wpa_supplicant/functions.sh: line 761: unexpected EOF while looking for matching `''
/etc/wpa_supplicant/functions.sh: line 833: syntax error: unexpected end of file
Setting lan1 interface eth0 metric to 10"

I am running out of patience!!!!

Offline

 

#17 2008-03-11 12:05:51 am

Cmiller82
Member
Registered: 2007-11-07
Posts: 12

Re: WPA keys with spaces work around

This fix is for WPA keys with spaces, I have a feeling your WPA key has one or more special characters in it... maybe a ` or a "  ?

You may not want to post your key, but it would help, and if I get some spare time I may be able to improve my modified scripts.

Thanks, and good luck.

Chris

Offline

 

#18 2008-03-15 6:58:19 am

Father Jack Hackett
New member
From: Craggy Island
Registered: 2008-03-07
Posts: 9

Re: WPA keys with spaces work around

Thanks for this, I copied the files as directed (backing up the old ones first) and I couldn't get it to work.

Did a bit of poking around and the files I copied didn't have execute permissions. set them as executable by all and now it works.

Offline

 

#19 2008-03-17 12:05:40 pm

Monode
New member
Registered: 2008-01-15
Posts: 3

Re: WPA keys with spaces work around

Father Jack Hackett : Would you mind telling us how you did that? (I'm a linux noob.)

Offline

 

#20 2008-03-20 8:59:11 am

spaceclam
New member
Registered: 2008-03-20
Posts: 1

Re: WPA keys with spaces work around

@Cmiller82

I'm using a 63 digit ASCII password (to include letters, numbers and special characters) on my WRT54G v2.  The encryption on my WRT54G v2 is set to WPA Personal AES.  I can not connect using the methods explained in this post, in the post entitled: Advanced WPA configuration on the default Xandros (without needing ndiswrapper), or even after attempting to install kernel sources from Asus and install madwifi (unsuccessfully).  I even spent some time on the phone with top-notch Asus technical support representatives.  Nada.

Let me add my cry to the collective.  "Asus!  You're killing us!"  I haven't slept in days, obsessing over this issue.  Yeah, I'm one of those people.  My eyes look like I've been beaten up (deep, dark suitcases).  I think I'm losing my mind.

**EDIT**

I emailed Asus support and here's the reply.  Granted, I already tried their phone support as well:

"Thank you for your support of our products!

Here are a few website that can help with any Eee pc issue. These site can also help you understanding Linux and how it works. If nether of these site can help you with your Eee pc problem feel free to call Asus

The first link give you alot of information and fixes and how to use the Eee PC

http://wiki.eeeuser.com/

The second give you information about new products for the Eee and a Forum where you can get information and ask question.

http://www.eeeuser.com/

If your Eee pc ASUS product needs to be repaired or exchanged, first try to exchange the item with your vendor. If this is not possible, you will need to contact our Tech department for assistance. There are three ways to contact them:

1) If you have Internet access, you can visit this website:

http://helpdesk.asus.com

Click on the ASUS RMA Online link, and request an RMA

2) Send an e-mail to:

RMA@asus.com

Please include your name, mailing address, telephone number, and the serial number of your product...."

And so on.  I'm over it.  I'll wait for a fix from Asus.  I'm running BT3b on an SDHC card, with no troubles whatsoever.  That's the main reason I got the eee pc.  If it comes down to it, I'll reformat the Xandros partition and other partitions on the SSHD and use it as a home drive.

Last edited by spaceclam (2008-03-21 12:15:16 am)

Offline

 

#21 2008-03-22 8:21:40 am

Father Jack Hackett
New member
From: Craggy Island
Registered: 2008-03-07
Posts: 9

Re: WPA keys with spaces work around

Monode wrote:

Father Jack Hackett : Would you mind telling us how you did that? (I'm a linux noob.)

Sorry, I'll try to explain.

It can all be done from the command line but it might be more familiar if you use the file manager :

1. Open a terminal (console). If in easy mode it's ctrl+alt+T, if in advanced mode, you'll find it on the launch menu Applications > System > Console.

2. at the prompt type "sudo XandrosFileManager" and press enter (without the quotes)

3. check all file systems are displayed  (its on the View menu)

4. in the left pane, click the "+"  next to all file systems to expand it; navigate like this to get to /etc/network/if-pre-up.d

5. right click on 001xandros-wireless-tools, then click properties

6. Click the permissions tab

7. This is where you can set file permissions. You need to set the file so that it's access permissions are :
    Owner - Read/Write/Exec
    Group  - Read/Exec
    Others - Read/Exec
(a cross in the box means it's set)

8. Click OK

9. Repeat for xandros-wpa-config in /usr/sbin/

----------or---------------

When in a terminal type "sudo chmod 755 /etc/network/if-pre-up.d/001xandros-wireless-tools" and "sudo chmod 755 /usr/sbin/xandros-wpa-config"

I've shown both methods because the first will show you a bit about permission whereas the second will just do it

HTH

Offline

 

#22 2008-04-04 3:59:02 am

Lobo
New member
From: France
Registered: 2008-04-04
Posts: 1
Website

Re: WPA keys with spaces work around

There are also issues with WPA keys having '=' and ':' characters (which was my case).

I was able to fix by changing the 2 files below
it's not a perfect fix (it won't work if you have the sequence ' s:'  or ' psk='  in your key) but it should work in most of the cases.

in the file /etc/network/if-pre-up.d/0001xandros-wireless-tools
around line 307, replace

Code:

        
    if [ -n "`echo $IF_WIRELESS_KEY | grep ^s:`" ]; then
        IF_WIRELESS_KEY=`echo $IF_WIRELESS_KEY | cut -f 2 -d ':'`
    fi

by

Code:

    if [ -n "`echo $IF_WIRELESS_KEY | grep ^s:`" ]; then
        IF_WIRELESS_KEY=`echo $IF_WIRELESS_KEY | awk -F " s:" '{print $2}'`
    fi

in the file /usr/sbin/xandros-wpa-config
around line 57, replace

Code:

PSK=`echo $PSKOUT | cut -d '=' -f 5 | cut -d ' ' -f 1`

by

Code:

PSK=`echo $PSKOUT | awk -F " psk=" '{print $2}'| cut -d ' ' -f 1`

Offline

 

#23 2008-04-25 4:13:01 pm

Feasoron
New member
Registered: 2008-04-25
Posts: 1

Re: WPA keys with spaces work around

I followed the above steps, but when I run through wireless tools the connection status never moves past pending, and the log stays blank. Do I need to do more than just copy these files with the proper permissions? Do I need to run something to ensure they are used instead of the tools with no 000 in front of them?

Offline

 

#24 2008-08-14 12:21:52 am

not2far
Member
Registered: 2007-10-02
Posts: 43

Re: WPA keys with spaces work around

I made all those changes and it still wouldn't let me use a passkey with spaces. any ideas?


4G Surf 2GB Ram Linux Noob - XP SP2 - Open Office

Offline

 

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson