Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to connect to Wi-Fi AP through WPS? All ways will be nice: configs, CLI, GUI - anything.

share|improve this question
This question appears to be abandoned. Unaccepted answer or unanswered, could you perhaps add more detail to your question? If this question no longer applies then you can either delete it or answer it yourself if you've solved the problem. Flagged for deletion. Thanks! – Ringtail Jan 13 '13 at 3:07
I have no possibility to try solution for any time, but it seems good. – Michael Jan 13 '13 at 7:07
@user51072 Did you try it? do you have a working solution? – Dejan Mar 31 '13 at 22:52

Solution from

  1. Set yourself up a very basic wpa_supplicant.conf in /etc/wpa_supplicant.conf:

  2. Start wpa_supplicant in daemon mode:

    wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf –B
  3. Run wpa_cli, and verify that it's working by issuing command status. You should see wpa_state=INACTIVE

  4. Fourth, lets add our BSSID and PIN:

    wps_reg xx:xx:xx:xx:xx:xx 12345678

    You should see an "OK". Wait a few more seconds as wpa_supplicant picks up the BSSID and tries to associate and perform key negotiation. What you want to see is CTRL-EVENT-CONNECTED, which will indicate that the PIN was accepted and that you're now associated.

    At this point, if you were to exit wpa_cli, you could run dhclient on wlan0 and would be offered an IP from the AP, assuming DHCPd were enabled.

    Go ahead and type the command save, which should output another "OK". This will update the wpa_supplicant.conf file, as specified from the command line, with a static configuration for this new network.

  5. Verify with: cat /etc/wpa_supplicant.conf

    If all went well, you should have a line under this new network titled psk.

Good luck!

share|improve this answer
Solution doesn't work. ioctl[SIOCSIWENCODEEXT]: Invalid argument using Ubuntu 12 LTS. Is there support in NM? – Dejan Mar 31 '13 at 22:48
@Dejan I got that warning as well in Ubuntu 12 LTS -- solution still worked though. – verlaner Dec 30 '13 at 19:21
@Seth Excuse me, as you know there is no wpa_supplicant.conf in Ubuntu 14.04. Could you please help me? Finally after getting a lots of error, in sudo wpa_cli status I got Failed to connect to non-global ctrl_ifname: (null) error: No such file or directory error. – Daniyal Dec 4 '15 at 13:15
@Daniyal You should ask a new question, comments aren't a good place for third party debugging :) – Seth Dec 4 '15 at 16:14
@Seth Thanks, could you please take a look at… – Daniyal Dec 4 '15 at 16:34

Tested using Ubuntu 16.04 LTS:

For WPS Push-button mode:

sudo wpa_cli wps_pbc

You can push the WPS button before or after this command, but you have two minutes to have the button pushed and this command ran or you'll have to do it all over again.

For WPS Pin mode:

sudo wpa_cli wps_pin any <the pin>

share|improve this answer
Doesn't work for me with Mint 17.3 and TP-Link TL-WR1043ND. Maybe "QSS" not the same as "WPS". – Michael May 10 at 17:26
You are correct, QSS is not the same as WPS.... But this question is about WPS, so.... – Brian Foster May 14 at 3:55

Connect through WPS on a windows setup, where it works out of the box.

Then open up the network settings on that setup, where it allows you to display the network password that was exchanged through WPS.

Copy that password to your ubuntu setup.

share|improve this answer
Don't know why this is being downvoted - it's a practical solution to the main reason this question is useful - that is "I don't know the WIFI password, but I have WPS access, how can I connect?" +1 This also work on android, with a root-mode file explorer, you can check the passwords in /data/misc/wifi/wpa_supplicant.conf. – naught101 May 28 '15 at 17:50
Ah, maybe the downvotes were for the comment about ubuntu being frustrating. Here is the relevant bug report - go an subscribe to that, if you want WPS support. – naught101 May 28 '15 at 17:53
Thanks for the Android tip, @naught101; worked beautifully from my rooted Nexus 7's terminal! :-) – Tommy Stanton Sep 21 '15 at 12:48

Your Answer


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.