Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Purdue Connect CLI

A command-line tool that makes Purdue campus network services scriptable from the terminal.

Overview

Purdue Connect streamlines access to Purdue University's network services by bringing Purdue's two-factor authentication (BoilerKey/Duo) into your terminal workflow. It stores your Purdue credentials and HOTP secret (the secret used to generate one-time passcodes) locally, so you can generate one-time passwords (OTPs) and sign in to the Purdue VPN or SSH servers without manually retrieving a code each time.

Features

  • HOTP secret management — register your BoilerKey/Duo HOTP secret from an activation link, a QR URI, or a QR image.
  • OTP generation — generate BoilerKey-compatible one-time passcodes from the CLI, without opening the Duo app.
  • Persistent credentials — store Purdue Career Account credentials for faster logins.
  • VPN connection — connect to Purdue's VPN through OpenConnect using an automatically generated OTP.
  • SSH access — SSH into Purdue servers with BoilerKey authentication handled for you.
  • Cross-platform — runs on Linux, macOS, and Windows (via WSL or a compatible VPN client).
  • Update check — notifies you when a newer purdue-connect release is available on PyPI.

Installation

Install from PyPI:

pip install purdue-connect

Verify the installation:

purdue-connect --help

Obtaining a Duo Mobile activation link

Several commands need your BoilerKey/Duo HOTP secret. You provide it once via a Duo Mobile activation link, which you can obtain as follows:

  1. Log in to a Purdue website (for example, mypurdue.purdue.edu) and reach the BoilerKey login prompt.
  2. Open Manage Devices (it may appear under "Other options" or a gear icon).
  3. Authenticate yourself (Duo Push, bypass code, or an existing device).
  4. Choose Add a new device and select Tablet.
  5. Copy the activation link shown below the QR code, or use the "Email me an activation link" option.
  6. Use this link in Purdue Connect during setup.

Usage

Set up your credentials

purdue-connect --set-credentials <username> <password>

Stores your Purdue Career Account username and password.

Set the HOTP secret

Register the HOTP secret using an activation link, a QR URI, or a QR image:

# From a Duo activation link
purdue-connect --set-link <activation-link>

# From a QR URI
purdue-connect --set-qr-link <qr-uri>

# From a QR image
purdue-connect --set-qr-img <image-path>

Generate an OTP

purdue-connect --otp

Prints a six-digit one-time passcode for BoilerKey authentication.

Connect to the Purdue VPN

sudo purdue-connect --vpn

After running --vpn, a second terminal opens for follow-up commands. The original terminal that hosts the VPN connection will prompt for your computer user password to start the connection.

SSH to Purdue servers

purdue-connect --ssh <hostname>

For example:

purdue-connect --ssh scholar.rcac.purdue.edu

Authenticates using your stored credentials and an automatically generated OTP.

To reach servers that require VPN access (such as ececomp), connect with --vpn first, then run --ssh in the newly opened terminal.

Troubleshooting

OpenConnect not found

Install OpenConnect for your platform:

# Ubuntu/Debian
sudo apt install openconnect

# Fedora
sudo dnf install openconnect

# macOS
brew install openconnect

On Windows, install Cisco AnyConnect from webvpn.purdue.edu, or use WSL.

SSH connection issues

  • Confirm the Purdue VPN is connected if the target server requires it.
  • Re-check your stored credentials with purdue-connect --set-credentials <username> <password>.

Invalid or rejected OTP

  • Make sure your system clock is correct.
  • Retry with a freshly generated OTP.
  • Verify the saved HOTP secret.

License

Purdue Connect is a closed-source project. Redistribution, modification, and contributions are not permitted.

About

A command-line tool that makes Purdue campus services scriptable from the terminal.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors