Score:0

How to connect raspberry pi to WIFI that requires username and password?

gb flag

I am trying to connect my raspberry pi to a wifi that requires an account to login i.e username and password. I have successfully connected the pi to an open wifi that only requires SSID and password but I cannot find the option to add username.

I used the netplan 50-cloud-init.yaml file as bellow with my SSID and password.

What do i need to add to put in my username.

network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            optional: true
    wifis:
        wlan0:
            optional: true
            access-points:
                "MY_HIDEN_SID":
                    password: "MY_PASSWORD"
            dhcp4: true
24601 avatar
in flag
how does this relate to ubuntu?
amtoum avatar
gb flag
The raspberrypi runs ubuntu
TuxInvader avatar
in flag
See: https://askubuntu.com/questions/1124164/how-do-you-configure-netplan-on-ubuntu-to-store-802-1x-credentials-securely
Score:0
us flag

If the wifi requires a username and password in order to connect to the AP, then you are not using wpa-psk (the default authentication, password-only) but you are probably instead using wpa-eap. For this, you need a configuration that looks like:

wifis:
    wlan0:
        optional: true
        access-points:
            "MY_HIDDEN_SID":
                auth:
                  key-management: eap
                  identity: MY_USERNAME
                  password: "MY_PASSWORD"
        dhcp4: true

More information can be found at https://netplan.io/examples/#connecting-to-wpa-enterprise-wireless-networks.

If your network is configured such that you can associate with the AP without a username, but you have to enter a login and password on a portal in order to connect to the Internet, then that is not something that netplan supports managing. To non-interactively interact with a wireless portal, you would need to do scripting around a tool such as wget or curl that you would launch after the network interface comes up.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.