expiron / tsauth

A tiny client for Tsinghua network AAA system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TsinghuaAuth

License Build Status

A tiny client for Tsinghua network AAA (Authentication, Authorization, Accounting) system.

Build and Install

  • Ubuntu 18.04

  1. Install dependencies
$ sudo apt-get update
$ sudo apt-get install build-essential cmake
$ sudo apt-get install libmbedtls-dev libcurl4-openssl-dev libjson-c-dev
  1. Clone sources
$ git clone https://github.com/expiron/tsauth.git
  1. Build
$ mkdir -p tsauth/build && cd tsauth/build
$ cmake ..
$ make -j 1 V=sc
  1. Install to /usr/local/bin
$ sudo make install
  1. Enjoy it
$ tsauth --help

TsinghuaAuth v0.5.1

    A tiny client for Tsinghua network AAA system

Usage:
    tsauth --status
    tsauth [OPTIONS] [--login] [--net] [-d <IP>] -u <username> -p <password>
    tsauth [OPTIONS] --logout [-d <IP>] -u <username>

Options:
    -d, --addr <IP address>        Specify the IP address to authorize
        --http                     Use HTTP for requests instead of HTTPS
        --inside                   Authorize campus internal network only
    -i, --login                    Perform login operation (default)
    -o, --logout                   Perform logout operation
    -n, --net                      Perform request to net.tsinghua.edu.cn
    -u, --username <username>      Tsinghua username or ID number
    -p, --password <plaintext>     Password in plaintext
    -s, --status                   Show native network status
    -t, --timeout <seconds>        Timeout of each request (default: 1)
    -v, --verbose                  Show detailed information
    -h, -?, --help                 Show usage and quit
        --version                  Show version string and quit

Usage Examples

  • Show native network status (remote address not supported)
$ tsauth --status
  • Authentication for current device
$ tsauth [--login] -u username -p password
  • Authentication only for campus internal network
$ tsauth -u username -p password --inside
  • Authentication for specified IP address
$ tsauth -d ip -u username -p password
  • Login net.tsinghua.edu.cn
$ tsauth --net -u username -p password
  • Logout
$ tsauth -ou username
  • Logout for specified IP address
$ tsauth -ou username -d ip

Limitation

  • It seems that all the IPs will be authenticated in double-stack mode. --ipv4, --ipv6 options are deprecated.

About

A tiny client for Tsinghua network AAA system.

License:GNU General Public License v3.0


Languages

Language:C 83.5%Language:CMake 11.8%Language:Shell 4.7%