Skip to main content

使用 CLI 进行中科院计算所上网认证登陆

Project description

ICT Auth

✨全新的 2.0 版本:使用 pip 即可安装并且无需 sudo 权限

使用 CLI 进行中科院计算所上网认证登陆。

核心想法:

  • ipv6 网络在未认证的情况下可用
  • 使用浏览器的无头模式来模拟网页操作

安装

pip install ict-auth

这会通过 ipv6 网络下载安装包并进行安装。

常见问题:

  1. 如果服务器上没有安装 pip,可以尝试运行以下命令来获取 pip。

    • 方法一(ensurepip):

      python -m ensurepip --upgrade
      
    • 方法二(get-pip.py)

      curl -O https://bootstrap.pypa.io/get-pip.py
      python get-pip.py
      
  2. 如果服务器正确连接网线但没有获取到公网 ipv6 地址,可以在本地手动下载 whl 安装包再使用 scp 拷贝至远程服务器

  3. 如果安装后找不到 ict_auth 命令,可以尝试重新登录或根据实际添加路径到环境变量中。

使用

登陆/退出/当前状态

ict_auth

这会检测当前的登陆状态:

  • 如果是未登录情况,默认会进行登陆过程
  • 如果已登录,则会打印当前信息,并询问是否退出登陆

自动重连 (Beta)

据观察,所里的网络偶尔会自动断开,可以使用 enable 将程序注册为后台服务,持续检测上网认证状态。如果监测到网络断开,则自动进行登陆。默认检测频率为每分钟 1 次,如果程序出错(网络波动导致无法访问认证页面等情况)则十分钟后进行重试。

注意:这会在本地明文保存账号与密码,存在账号安全隐患(待优化)

ict_auth enable

# 让用户即使在没有登录的情况下,依然能够保持后台的服务运行
loginctl enable-linger $USER

使用 disable 取消持久连接(这会卸载系统服务并清空账号信息)

ict_auth disable

使用 logs 查看持久连接日志

ict_auth logs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ict_auth-2.1.2.tar.gz (98.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ict_auth-2.1.2-py3-none-any.whl (98.9 MB view details)

Uploaded Python 3

File details

Details for the file ict_auth-2.1.2.tar.gz.

File metadata

  • Download URL: ict_auth-2.1.2.tar.gz
  • Upload date:
  • Size: 98.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ict_auth-2.1.2.tar.gz
Algorithm Hash digest
SHA256 901c9fd241ab0291ed34e354bab5a44035c8035437aa06cc9fc42d61cbc93d6a
MD5 d24cdb9ea7f8c6f6b56427eaed150e6b
BLAKE2b-256 37473c81511dd0624a04068964444325bfcb824c0ee820faa2e83cde97a05bcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ict_auth-2.1.2.tar.gz:

Publisher: build_test_publish.yml on jklincn/ict_auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ict_auth-2.1.2-py3-none-any.whl.

File metadata

  • Download URL: ict_auth-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 98.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ict_auth-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3849dfdde2186201426437fac41e2d298677606fbe9311fb986af5b59b827f69
MD5 5e72760d9661c8703d23d9869f7d97e2
BLAKE2b-256 a5bffcd05408b92420cada6df1eeb19a44005572828a9a0a3d9e5ac21d4cea22

See more details on using hashes here.

Provenance

The following attestation bundles were made for ict_auth-2.1.2-py3-none-any.whl:

Publisher: build_test_publish.yml on jklincn/ict_auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page