Skip to content

Instantly share code, notes, and snippets.

@Kasama
Last active August 1, 2023 15:49
Show Gist options
  • Save Kasama/5750bd0a2841843c41efbc2d74301aef to your computer and use it in GitHub Desktop.
Save Kasama/5750bd0a2841843c41efbc2d74301aef to your computer and use it in GitHub Desktop.
login into eduroam wifi network via terminal

To login into eduroam from the command line you'll need to have wpa_supplicant package installed. It is part of the core of most Linux distributions, to check if you have it run wpa_supplicant -v

Create profile file

Start by creating a profile file for the network:

wpa_passphrase  <ssid> > <ssid>.profile

Replace above with your network's SSID (likely eduroam). Type your network's password into the prompt and press Enter

Edit profile file

Open the <ssid>.profile file in a text editor. You should see something like this:

# reading passphrase from stdin
network={
        ssid="<ssid>"
        #psk="<your passphrase>"
        psk=eb5a2f0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7671b654
}

Now add some fields to the network configuration:

phase2="auth=MSCHAPV2"
identity="<your username>"
password="<your passphrase>"

The profile should now look like this:

# reading passphrase from stdin
network={
        ssid="<ssid>"
        #psk="<your passphrase>"
        psk=eb5a2f0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7671b654
        phase2="auth=MSCHAPV2"
        identity="<your username>"
        password="<your passphrase>"
}

Connecting to the network

To connect to the network using an existing profile file you first need your network interface name.

ip link

You should see one that looks like wlpXsY or wlanX, note that name.

Now you can connect to the network by running:

wpa_supplicant -i<interface_name> -c/path/to/your/profile/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment