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-0.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

l0n0l2fa-0.1.0-py3-none-any.whl (450.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for l0n0l2fa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea79dcc4ada0bcef9e65497c53d52b88189f84555b7375229d7913bc20b2a3b7
MD5 b428b9e936b618313512c4134bb54ce4
BLAKE2b-256 4e52100a6f593010f7e3a42a076ee09529153213068de68fe0f2564547ba8bb3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for l0n0l2fa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71f27f2dfa044fadcff0b32ab9cc4b2d97f8a87a9f9fe6c80494f7aae2f5f2be
MD5 f5659023fd844555196213fd0658bd42
BLAKE2b-256 202b4fdc47478249bc7f5daac63934a5ed1cb71304c4f3f6b1bf03505e36d7d2

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