[SOLVED] Trouble connect to a username and password wifi using wpa_supplicant
Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you're using networkmanager, let that do the heavy lifting. There's also nm-tui for TextUserInterface. If you're doing this by hand, start with wpa_passphrase if you haven't done so. Use the man page to get from your wifi password to psk conversion. First time, I was caught by that. Put all that in your wpa_supplicant.conf.
You can put several protocols in wpa-supplicant.conf. I use WPA-PSK, and that works.
You command looks reasonable. Take out the '-B' and you get it logging to the terminal. Put that back in once you're happy. You also need to add '-D nl80211' at the front to give it a kernel driver.
When you're entering this from a terminal, you can do the connection on one line by adding ' && sudo dhcpcd -w wlp62s0' Then both programs should connect with output, then fork to the background in turn.
With all wireless connectivity, it takes two to tango... sometimes three depending on the deployment, for example dot1x over the wireless. But we will not cover that atm
First, the wireless access point (WAP) which can be a stand-alone device (enterprise/small business) or integrated into your router (common for home setup) has to be configured with the desired protocol(s) and parameters.
Second, the client must support the advertised authentication protocol(s) by the WAP and of course has the latest drivers due to resolved bugs, new features, etc.
If you inform what your WAP is configured with, we can very likely assist.
Also as root or a sudoer, what WNIC you have with this command: /usr/sbin/lshw -C network
My WAP ssid is configured for and is advertising WPA3-Personal and not WPA-EAP.
I call wpa_supplicant like below where my integrated wireless device is wlan0
1. Bring up wlan0 /sbin/ifconfig wlan0 up
2. Start wpa_supplicant with the wnic /usr/sbin/wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
3. Acquire a DHCP address /sbin/dhclient -4 wlan0 -v
4. View the wnic settings /sbin/iwconfig wlan0
My file /etc/wpa_supplicant.conf is below but yours should differ based on your WAP configuration towards your broadcasted ssid. network={
scan_ssid=1
ssid="thisisprivate"
key_mgmt=SAE
sae_password="thisisevenmoreprivate"
ieee80211w=2
}
This works for me as long as wpa_supplicant has all the required supporting binaries and other files. Easy to check with the following commands: /usr/sbin/wpa_supplicant -v ldd /usr/sbin/wpa_supplicant
You can also view the options for wpa_supplicant but running this command man wpa_supplicant
Last edited by yvesjv; 03-17-2023 at 03:05 PM.
Reason: more info required
If you're using networkmanager, let that do the heavy lifting. There's also nm-tui for TextUserInterface. If you're doing this by hand, start with wpa_passphrase if you haven't done so. Use the man page to get from your wifi password to psk conversion. First time, I was caught by that. Put all that in your wpa_supplicant.conf.
You can put several protocols in wpa-supplicant.conf. I use WPA-PSK, and that works.
You command looks reasonable. Take out the '-B' and you get it logging to the terminal. Put that back in once you're happy. You also need to add '-D nl80211' at the front to give it a kernel driver.
When you're entering this from a terminal, you can do the connection on one line by adding ' && sudo dhcpcd -w wlp62s0' Then both programs should connect with output, then fork to the background in turn.
Woah, you’ve been on this forum longer than I’ve been alive.
Anyways, I didn’t know that psk and password are two different things. I’ll look into this. I tried using nmcli earlier but still couldn’t get it working. I’ve never used -D nl80211 and sudo dhcpcd -w wlp62s0 before. Are these parts only necessary when using username/password wifi or should I use them even on normal wifis? My home network always works without me needing using these.
I’m not going to be back at my school with the network issue for 10 days so I wont get to try what you said for 10 days but I’ll write another reply if I can’t get it working then.
If you inform what your WAP is configured with, we can very likely assist.
I don't know how to find this out but I think it may be [ESS]. I wont be back at my school for 10 days so I won't be able to run a scan but I rememebr that the network appeared different than every other network when I looked at the scan_results and also it said [ESS] and I think this is a flag.
I also know that when I did enable_network x
it returned
CTRL-EVENT-SCAN-RESULTS
CTRL-EVENT-NETWORK-NOT-FOUND
Quote:
Originally Posted by yvesjv
Also as root or a sudoer, what WNIC you have with this command: /usr/sbin/lshw -C network
not sure what the key_mgmt=WPA-EAP means but I saw others doing it
The EAP in WPA-EAP is Extensible Authentication ProtocoL. Basically it requires additional authentication which provides additional security and auditing by requiring a username and password to be able to login to the network. As posted 801.x requires additional settings from the typical home wireless network.
Did the school provide any information on how to connect to their wireless network? If so did they provide any additional information besides the username and password? There are several different types of authentication methods and without knowing the details it isn't possible to post exactly how to setup the configuration file. You might have to ask their IT department for help.
While it isn't necessarily important what linux distribution / version is your device running?
I did not see your latest post but Wi-Fi 6 AX200 requires a fairly newer kernel.
As Michaelk pointed to, you will require more assistance/information before going further with configuring your wpa_supplicant.conf file and making use of it.
Towards my clients on the enterprise network, I use the NetworkManager gui on their laptops to configure their wireless. Much easier for the clients and you could consider when back at school?
Usually when using the wpa-cli command you will see the below
wlan0 is my wireless nic.
And if you require more assistance, please provide the requested information. wpa-cli -i wlan0 <3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
I don't usually wait much after seeing <3>CTRL-EVENT-SCAN-STARTED and I then run the command below scan_results
This will then show something similar to this example below bssid / frequency / signal level / flags / ssid
7c:26:64:0c:21:24 2472 -82 [WPA2-PSK-CCMP][WPS][ESS] BelongXETRRQGP
48:d2:4f:32:2d:3a 2412 -86 [WPA2-PSK-CCMP][WPS][ESS] Belong322D34
a4:91:b1:2c:2d:7f 2462 -92 [WPA2-PSK-CCMP][WPS][ESS] Telstra2C2D7F
Nothing wrong with asking your IT administrators at school for assistance, in most cases they would be keen to assist a client.
But If you require further assistance, please provide the requested information.
Woah, you’ve been on this forum longer than I’ve been alive.
Anyways, I didn’t know that psk and password are two different things. I’ll look into this. I tried using nmcli earlier but still couldn’t get it working. I’ve never used -D nl80211 and sudo dhcpcd -w wlp62s0 before. Are these parts only necessary when using username/password wifi or should I use them even on normal wifis? My home network always works without me needing using these.
I’m not going to be back at my school with the network issue for 10 days so I wont get to try what you said for 10 days but I’ll write another reply if I can’t get it working then.
If your 'home network always works' you're using networkmanager. There's 2 ways of doing this
Use networkmanager, usually in X.
Use init scripts, where you need wpa_supplicant.
When you see instructions for one set, they usually forget the other way exists. I use the scripts on Slackware, but Debian has systemd & networkmanager. And yes I'm old. The Governmemnt here used to pay me for being decrepit (Disability Allowance), but now it pays me for being ancient, and the fringe benefits are better . And you're probably at the stage when you're not quite ready to pay your own way while you still know everything . Enjoy it - you'll be old before you know it .
The EAP in WPA-EAP is Extensible Authentication ProtocoL. Basically it requires additional authentication which provides additional security and auditing by requiring a username and password to be able to login to the network. As posted 801.x requires additional settings from the typical home wireless network.
Did the school provide any information on how to connect to their wireless network? If so did they provide any additional information besides the username and password? There are several different types of authentication methods and without knowing the details it isn't possible to post exactly how to setup the configuration file. You might have to ask their IT department for help.
While it isn't necessarily important what linux distribution / version is your device running?
I did not see your latest post but Wi-Fi 6 AX200 requires a fairly newer kernel.
No, they haven't provided any information besides how to connect to it on windows and mac which is just: click the wifi icon then click connect on their network and open a browser then you will be prompted for usernamend password.
As Michaelk pointed to, you will require more assistance/information before going further with configuring your wpa_supplicant.conf file and making use of it.
Towards my clients on the enterprise network, I use the NetworkManager gui on their laptops to configure their wireless. Much easier for the clients and you could consider when back at school?
Usually when using the wpa-cli command you will see the below
wlan0 is my wireless nic.
And if you require more assistance, please provide the requested information. wpa-cli -i wlan0 <3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
I don't usually wait much after seeing <3>CTRL-EVENT-SCAN-STARTED and I then run the command below scan_results
This will then show something similar to this example below bssid / frequency / signal level / flags / ssid
7c:26:64:0c:21:24 2472 -82 [WPA2-PSK-CCMP][WPS][ESS] BelongXETRRQGP
48:d2:4f:32:2d:3a 2412 -86 [WPA2-PSK-CCMP][WPS][ESS] Belong322D34
a4:91:b1:2c:2d:7f 2462 -92 [WPA2-PSK-CCMP][WPS][ESS] Telstra2C2D7F
Nothing wrong with asking your IT administrators at school for assistance, in most cases they would be keen to assist a client.
But If you require further assistance, please provide the requested information.
Yeah I'm sure I could get it to work using the network manager gui, but I didn't want to install network manager just for one specific network. I'll attempt to get additional information.
If your 'home network always works' you're using networkmanager. There's 2 ways of doing this
Use networkmanager, usually in X.
Use init scripts, where you need wpa_supplicant.
When you see instructions for one set, they usually forget the other way exists. I use the scripts on Slackware, but Debian has systemd & networkmanager. And yes I'm old. The Governmemnt here used to pay me for being decrepit (Disability Allowance), but now it pays me for being ancient, and the fringe benefits are better . And you're probably at the stage when you're not quite ready to pay your own way while you still know everything . Enjoy it - you'll be old before you know it .
I've never had networkmanager installed untill now, so is it really possible for me to be using networkmanager even without it installed?
No, they haven't provided any information besides how to connect to it on windows and mac which is just: click the wifi icon then click connect on their network and open a browser then you will be prompted for username and password.
At first glance that appears to be an open network with a captive portal. The following might work, once you are connected to the WAP then as instructed open a browser. If you are not automatically directed to the proper login page just try using any URL and hopefully it will be redirected. If that does not work hopefully you can find someone in the IT department. Good luck.
No, they haven't provided any information besides how to connect to it on windows and mac which is just: click the wifi icon then click connect on their network and open a browser then you will be prompted for usernamend password.
Running void linux with kernel 6.1.15_1
Nice choice of a distro.
The captive portal is used for it provides ability to log/allow a specific userID that has acquired an IP address to access services/internet/etc.
We use the captive portal in our environment for visitors, guests and sometimes staff too.
Once they are on the wireless ssid, open firefox (or similar) which has 'Captive portal detection' and you are redirected/prompted for your userID/password combination.
It's probable your school IT administrators have dot1x enabled for all staff, students and clients
Check with them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.