9

I am trying to locate the wpa_supplicant.conf on Ubuntu 14.04 with no luck. I tried to locate but I couldn't find it. the locate command gives the following output:

~$ sudo locate wpa_supplicant.conf  
/etc/dbus-1/system.d/wpa_supplicant.conf 
/home/pervysage/wpa_supplicant.conf
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf.gz
/usr/share/man/man5/wpa_supplicant.conf.5.gz

I am connected to my Wi-Fi so there must be a wpa_supplicant.conf file present, right? If so, why am I unable to locate it?

  • After years of fighting it for simple network connections, I'd honestly recommend just letting Network Manager handle things these days (especially when it comes down to wireless security). – Oli Jul 14 '14 at 10:01
  • I'm just seeing (and want to play with) the WiFi source code and want to give the computer my own wpa_supplicant. I want to backup the original just in case something messes up. – Pervy Sage Jul 14 '14 at 14:26
5

If you use NetworkManager to configure your wifi connections look in /etc/NetworkManager/system-connections

There should be files in there for all your configured network connections.

| improve this answer | |
  • 4
    But where's wpa_supplicant.conf? – James McLaughlin Sep 1 '15 at 22:30
  • If you use NetworkManager it looks after wireless settings for you. It doesn't create a wpa_supplicant.conf file with all the network settings in it. It stores connection settings in a bunch of connection files. – coderPatros Sep 3 '15 at 21:55
0

wpa_supplicant doesn't run with a conf. It's a daemon that communicates with your network manager using DBUS. You can see what's happening with wpa_cli which will show you the instructions being received by the daemon.

That's not to say you can not run with a configuration file, you can. But, Ubuntu doesn't use that configuration file at all. It's all remotely controlled through the DBUS api.

| improve this answer | |
0

The specific answer to the question "Where is my wpa_supplicant.conf?" is as follows:

Method 1:

Copy a specimen file from /usr/share/doc/ to /etc as per README instructions in line 262 in /usr/share/doc/wpasupplicant/README.Debian.gz :

# copy the template to /etc/wpa_supplicant/
cp /usr/share/doc/wpasupplicant/examples/wpa-roam.conf /etc/wpa_supplicant/wpa_supplicant.conf

# allow only root to read and write to file
chmod 0600 /etc/wpa_supplicant/wpa_supplicant.conf

I found the README file- and the specimen files to create a wpa_supplicant.conf - with:

dpkg -L wpasupplicant

Above answer produced from an Ubuntu 18.04 system.

Method 2

Put the following into a script, edit the directives with values specific to your setup, chmod 700 the file and execute it. It's minimal, but should suit most use cases. This should do all the related grunt work to get your wpa_supplicant configured.

#!/bin/bash

cat <<EOF> /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
ap_scan=1

network={
        ssid="SSIDNAME"
        psk="AP-WPA2-PASSWD-GOES-HERE"
}
EOF

chmod 0600 /etc/wpa_supplicant/wpa_supplicant.conf

usermod -G netdev -a pi

systemctl unmask wpa_supplicant.service
systemctl enable wpa_supplicant.service
systemctl start wpa_supplicant.service

Hope this helps you

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.