[How To] WPA Supplicant


Recommended Posts

Okay so this is the first guide I've ever attempted so go easy on me. I've broke and had to reinstall ubuntu so many times now that I figured I'll just write this up here. This guide is aimed helping you through setting up wpa_supplicant for any of the drivers that it supports, which will allow you to access wpa encrypted wireless networks.

This is based on the many threads at ubuntuforums.org so thanks to the good people of the Ubuntu world.

Note:

(1) It will not guide you through installing the drivers for your wireless card so I assumed that you already have it installed and working on non encrypted networks

(2) I use Ubuntu (Debian) so some parts of the install may not apply to or work the same way your distro.

(3) I am a noob at this stuff so it may not be perfect.

(4) My brain works slower than everything else so tell me if some parts trail off into incoherent babbling.

Part 1 - Installing WPA_Supplicant:

Installing from repositories/packages

If you have a package manager like apt-get or yum you can install wpa_supplicant through that. It will make your life a whole lot easier.

a) Installing from apt repositories:

sudo apt-get update
sudo apt-get install wpasupplicant

b) Installing from a .deb file

dpkg -i wpa_supplicant.deb

c) Installing from yum

yum install wpasupplicant

Installing from source:

Download the latest stable WPA_Supplicant source from here.

Extract the tar.gz

tar -xvzf wpa_supplicant-0.3.9.tar.gz
cd wpa_supplicant-0.3.9

Now you need to set up the compile options.

cp defconfig .config
nano .config

This is using the example config file that is provided. You need to uncomment the CONFIG_DRIVER part that lists the driver you are using.

Example:

If you are using ndiswrapper, change this

#CONFIG_DRIVER_NDISWRAPPER=y

To this

CONFIG_DRIVER_NDISWRAPPER=y

The rest of the options should be okay, don't mess with them unless you know what you are doing.

Save and exit.

make
sudo make install

Part 2 - Configuration:

nano /etc/default/wpasupplicant

Enable it by editing the file to:

ENABLED=1

Save and exit

Editing the config file:

sudo chmod 600 /etc/wpa_supplicant.conf
sudo nano /etc/wpa_supplicant.conf

If you compiled from source then you need add the following to the config file. If not then skip to the 'Setup ssid and WPA key' part.

 
#
 #wpa_supplicant.conf
 #
 ctrl_interface=/var/run/wpa_supplicant
 ctrl_interface_group=0
 eapol_version=1
 ap_scan=1
 fast_reauth=1

Setup the ssid and WPA key.

In the terminal type:

wpa_passphrase <ssid> <wpapassphrase>

This should give you something like:

network={

ssid="Network"

#psk="topsecretkey"

psk=d239jf9028qjf98437fpq934fhp9q34fha94hq34hq843fqo347f

}

Now copy that and you will need to paste it into your config file.

Also add this after the "psk=" part:

        key_mgmt=WPA-PSK
        proto=WPA

So the final section of the config should look like similar to this:

#
 #wpa_supplicant.conf
 #
 ctrl_interface=/var/run/wpa_supplicant
 ctrl_interface_group=0
 eapol_version=1
 ap_scan=1
 fast_reauth=1
network={
        ssid="Network"
        #psk="topsecretkey"
        psk=d239jf9028qjf98437fpq934fhp9q34fha94hq34hq843fqo347f
        key_mgmt=WPA-PSK
        proto=WPA
}

Now save and exit.

Part 3 - Running and automating it:

Now you can test if it is working.

sudo ifconfig wlan0 up

Note:

1) You may need to change the 'ndiswrapper' part to the name of the driver you are using.

2) You may also need to change 'wlan0' to the name for your wireless device. It may be 'ath0' for madwifi drivers or eth0 in some cases.

3) the -B switch runs this in the background. If you are having problems then you can view the debug output by removing the -B part and adding -dd to the end of this command.

sudo wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf
sudo dhclient wlan0

Now it should connect..

Automating it at startup

sudo nano /etc/network/interfaces

Add this:

(Again, you may need to change wlan0 and ndiswrapper to your device and driver name if it is different)

auto wlan0
iface wlan0 inet dhcp
pre-up /usr/sbin/wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

Now it should run at boot time.

Edited by Rob2687
Link to comment
https://www.neowin.net/forum/topic/399787-how-to-wpa-supplicant/
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I sort of agree with you on that. I had a telescope - a real hefty thing, although only around 500CHF - that got me so fascinated about the stars and planets. I would stare for hours, amazed that I could see the craters of the moon or the rings of Saturn in "realtime" (quotations because, y'know, speed of light and whatnot). A friend of mine has a telescope like the one mentioned in the review, and the pictures are amazing to look at. But there is something missing for me. I may as well just go to NASA's website and look through their gallery.
    • As opposed to catching bad press because it's the engine's fault? You didn't really think this through did you? lol
    • I think it depends on what you're looking for to do, and the time you have to spare. With my Dwarf 3, I easily spend 3-4 hour sessions; half an hour driving to an un-light polluted place, another half hour unpacking and setting up the smart scope + tripod for equatorial tracking, then 15 more minutes mucking around with settings and shooting calibration frames, spending a few hours shooting, merging with past photo sessions, etc. It's crazy how time flies and I often get home later than I expected. It's something I still need to set aside a good part of an evening to do, all in all. For one session, where you often need like four for best results when it comes to deep space objects. Even with a smart scope like Dwarf 3, regular non-astro photography is still way more approachable to people getting into photography. I find this is a time consuming niche no matter how I go about it. With practice, I can probably begin cutting time here but I think where smart scopes find their home is among people who love to shoot the night sky but don't have the spare time to go deep with the "navigator level" attunement to the night sky itself in addition to everything else. Having said this, _if_ you have even more time to spend on this hobby, it will probably be even more rewarding to do it more by hand and learn the skies and the details of how it all works.
    • I misread the title and thought Teams itself would be redesigned. Imagine having this one as a native WinUI app.
    • Dell, HP PCs ran into endless reboot, BitLocker recovery loops but Windows 11 isn't to blame by Sayan Sen Last month Neowin reported on a major issue on Dell systems wherein a bug in its official support tool was leading to endless blue screen of death (BSOD) and restarts. Following our report, Dell officially acknowledged its SupportAssist-related crash issue, confirming that the culprit is not Microsoft's operating system but rather a faulty version of its own remediation software. In a newly published support advisory, Dell stated that version 5.5.16.0 of Dell SupportAssist Remediation and Alienware SupportAssist Remediation can trigger blue screen errors and unexpected system restarts. The company notes that the problematic component operates independently of the main SupportAssist application, meaning users should not remove the primary SupportAssist software when troubleshooting the issue. According to Dell, the crashes are linked specifically to the SupportAssist Remediation service, which is bundled with SupportAssist OS Recovery Tools, and as such it has since released an updated version, 5.5.16.1, which is said to resolve the problem. Affected users are advised to first verify whether version 5.5.16.0 is installed by checking the Installed Apps section in Windows Settings. If so, Dell recommends updating SupportAssist OS Recovery Tools through either SupportAssist's "Update Software" feature or Dell Command Update. Dell also advises users to back up important data before performing the update and to ensure systems remain connected to power throughout the installation process. If you are still having issues though make sure to report to the Dell support forum. As it turns out though Dell is not the only PC maker currently dealing with update-related headaches as HP is also facing a separate but probably equally frustrating issue involving recent Windows Secure Boot updates that were released with recent Windows 11 Patch Tuesdays. Similar to Dell, HP also put up its own support article where it explains the issue. The company says that affected devices could hit a brick wall when booting as they run into a BitLocker recovery loop after the April 2026 updates. The problem appears to affect systems wherein the new UEFI Secure Boot CA 2023 certificates fail to apply properly. As such affected users will find themselves entering their recovery key over and over again despite the system otherwise functioning normally. HP says such PCs should be updated to the latest available BIOS version and configured with the necessary Secure Boot certificates before installing Microsoft's Windows 11 Patch Tuesday updates. Systems that are already experiencing the problem may require BIOS configuration changes to restore normal boot behavior. Admins can find information regarding that in the support article here on HP's official website.
  • Recent Achievements

    • One Month Later
      DJC50PLUS earned a badge
      One Month Later
    • Week One Done
      DJC50PLUS earned a badge
      Week One Done
    • Proficient
      Eric Biran went up a rank
      Proficient
    • Dedicated
      Conjor earned a badge
      Dedicated
    • Week One Done
      Windows Guy earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      PsYcHoKiLLa
      246
    3. 3
      Steven P.
      72
    4. 4
      +Edouard
      69
    5. 5
      neufuse
      68
  • Tell a friend

    Love Neowin? Tell a friend!