Skip to main content

TOTP 2FA

Project description

1. 介绍

TOTP 2FA动态密码服务器

2. 安装

pip install l0n0l2fa

3. 配置文件介绍(tokens_otp.json)

[
  {
    "token": "token", // 自定义, 唯一访问凭证
    "user": "动态密码", // 用户名
    "secrets": [
      {
        "name": "user1", // 密码的标签, 自定义
        "secret": "user1密码" // 密码, 由需要2fa的服务提供(github, pypi ...)
      },
      {
        "name": "user2", // 密码的标签, 自定义
        "secret": "user2密码" // 密码, 由需要2fa的服务提供(github, pypi ...)
      }
    ]
  }
]

4. 命令介绍

l0n0l2fa -h
usage: l0n0l2fa [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE] [--tokens TOKENS]

OTP 管理服务

options:
  -h, --help           show this help message and exit
  --host HOST          监听地址 (默认: 127.0.0.1)
  --port PORT          监听端口 (默认: 8080)
  --certfile CERTFILE  SSL 证书文件路径 (可选)
  --keyfile KEYFILE    SSL 私钥文件路径 (可选)
  --tokens TOKENS      Token 配置文件路径 (默认: tokens_otp.json)

5. 实例

1. 编辑好配置文件到运行目录(比如 /path/l0n0l2fa/tokens_otp.json)

1.1 打开github (https://github.com)并登录账号

1.2 进入设置

1.3 进入 Password and Authentication

1.4 进入编辑

1.5 获取密码

2. 编辑配置文件(/path/tokens_otp.json)

[
  {
    "token": "kjasldjflkasjdfiwieijwruowejrikasdjfkl",
    "user": "动态密码",
    "secrets": [
      {
        "name": "github",
        "secret": "AMIOEQ2C2QH4NEIT"
      }
    ]
  }
]

3. 启动服务器

l0n0l2fa --tokens /path/tokens_otp.json
有效用户配置已加载:
  user=动态密码 token=kjasldjflkasjdfiwieijwruowejrikasdjfkl secrets=1
🌐 启用 HTTP: http://127.0.0.1:8080/web
======== Running on http://127.0.0.1:8080 ========
(Press CTRL+C to quit)

4.访问 http://127.0.0.1:8080/web 并输入token

5.复制动态密码

6. 将动态密码填入github并保存

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

l0n0l2fa-1.0.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

l0n0l2fa-1.0.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file l0n0l2fa-1.0.0.tar.gz.

File metadata

  • Download URL: l0n0l2fa-1.0.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for l0n0l2fa-1.0.0.tar.gz
Algorithm Hash digest
SHA256 457ed42d4938d4503f970b088bc9bc2996f1f443bea34a1853e9234414894ff7
MD5 eaaa6d46aa43283a5af0fd01119f07ab
BLAKE2b-256 1ab4650a9db95d357f42dcb89b5a6d05a53d6a73b681476ccb46c80ac652703f

See more details on using hashes here.

File details

Details for the file l0n0l2fa-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: l0n0l2fa-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for l0n0l2fa-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36b8c3a76e7439fba6864d2befea4515a4b40f112704900cb6dcdf6a2e8363b7
MD5 bd1f0a6b0e28b38145077401036a0442
BLAKE2b-256 cb130c5bcea96c24ca5f1a321205d2477dee2228b8f0724e4d02adbbee614a6c

See more details on using hashes here.

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