使用 CLI 进行中科院计算所上网认证登陆
Project description
ICT Auth
✨全新的 2.0 版本:使用 pip 即可安装并且无需 sudo 权限!
使用 CLI 进行中科院计算所上网认证登陆。
核心想法:
- ipv6 网络在未认证的情况下可用
- 使用浏览器的无头模式来模拟网页操作
安装
pip install ict-auth
这会通过 ipv6 网络下载安装包并进行安装。
常见问题:
如果服务器上没有安装 pip,可以尝试运行以下命令来获取 pip。
方法一(ensurepip):
python -m ensurepip --upgrade方法二(get-pip.py)
curl -O https://bootstrap.pypa.io/get-pip.py python get-pip.py如果服务器正确连接网线但没有获取到公网 ipv6 地址,可以在本地手动下载 whl 安装包再使用 scp 拷贝至远程服务器
如果安装后找不到
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
901c9fd241ab0291ed34e354bab5a44035c8035437aa06cc9fc42d61cbc93d6a
|
|
| MD5 |
d24cdb9ea7f8c6f6b56427eaed150e6b
|
|
| BLAKE2b-256 |
37473c81511dd0624a04068964444325bfcb824c0ee820faa2e83cde97a05bcc
|
Provenance
The following attestation bundles were made for ict_auth-2.1.2.tar.gz:
Publisher:
build_test_publish.yml on jklincn/ict_auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ict_auth-2.1.2.tar.gz -
Subject digest:
901c9fd241ab0291ed34e354bab5a44035c8035437aa06cc9fc42d61cbc93d6a - Sigstore transparency entry: 252769114
- Sigstore integration time:
-
Permalink:
jklincn/ict_auth@82a527d1051c95f2cdb6bdf8a5ef73188aee2153 -
Branch / Tag:
refs/tags/v2.1.2 - Owner: https://github.com/jklincn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_test_publish.yml@82a527d1051c95f2cdb6bdf8a5ef73188aee2153 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3849dfdde2186201426437fac41e2d298677606fbe9311fb986af5b59b827f69
|
|
| MD5 |
5e72760d9661c8703d23d9869f7d97e2
|
|
| BLAKE2b-256 |
a5bffcd05408b92420cada6df1eeb19a44005572828a9a0a3d9e5ac21d4cea22
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ict_auth-2.1.2-py3-none-any.whl -
Subject digest:
3849dfdde2186201426437fac41e2d298677606fbe9311fb986af5b59b827f69 - Sigstore transparency entry: 252769141
- Sigstore integration time:
-
Permalink:
jklincn/ict_auth@82a527d1051c95f2cdb6bdf8a5ef73188aee2153 -
Branch / Tag:
refs/tags/v2.1.2 - Owner: https://github.com/jklincn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_test_publish.yml@82a527d1051c95f2cdb6bdf8a5ef73188aee2153 -
Trigger Event:
push
-
Statement type: