Skip to main content

Easy and quick set interesting linux login banner.

Project description

Cool Login Banner

方便快捷的定制好玩的linux登录界面。

目录

安装

pip install cool-login-banner

描述

Cool Login Banner 设置主机登陆界面最快只需要2步:

  1. 创建 BannerSetter 对象。

  2. 调用不同的方法设置对应的登陆banner。

from cool_login_banner import BannerSetter, CowsayEngine

bs = BannerSetter(CowsayEngine, host='192.168.44.131', user='username', port=22, password='password')
bs.set_ssh_banner(text="A python enthusiast's site", pattern='cow', fore_color='lightyellow_ex', styles=['blink'])

登录主机,登录页面就变成这样了:

./docs/img/login_banner.gif

恢复也很容易:

bs.clear_ssh_banner()

基于 colorama, pyfigletcowsay, 一共有三种不同风格的banner引擎:

./docs/img/text_engine.png ./docs/img/figlet_engine.png ./docs/img/cowsay_engine.png

基本用法

远程或本地

BannerSetter 类会根据是否传递 host 参数来判断是远程连接还是本地执行。

如果是远程登陆,所有关键字参数都会送给 fabric.Connection, 除了 password 参数。因为 Connection 如果需要设置登陆密码,需要在 connect_kwargs 这个关键字参数里面设置,我觉得很不方便,进行了合并。

本机执行程序的话,除了 engine, 就不用传递额外参数了。不过不管是远程还是本机,账号需要有sudo的权限,如果sudo 需要密码,则需要提供 password 参数。

说明

Cool Login Banner 只是简单的进行了组合。感谢超级cool的 pyfiglet, cowsay-python, colorama

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

cool_login_banner-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

cool_login_banner-0.1.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file cool_login_banner-0.1.2.tar.gz.

File metadata

  • Download URL: cool_login_banner-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.12.0 Windows/11

File hashes

Hashes for cool_login_banner-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0f81456929618b358ee7a0110ef573b1a0cb9e065216820d34547f412043a349
MD5 a94a5643e5be1119e50498367bc51f81
BLAKE2b-256 2d7fa3bd34e26efe5727ce33945837d8fa357e190acd143c74c4945c8321c540

See more details on using hashes here.

File details

Details for the file cool_login_banner-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cool_login_banner-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.12.0 Windows/11

File hashes

Hashes for cool_login_banner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c017bd47e4f28d26bf0797905cc8b20f1296e105816585efa9b2e739d7a3c052
MD5 b12030ae0e059b6ee82a59557472ce8f
BLAKE2b-256 2e31bda289adea86069f8569050746461882cce54ba4f0f0a5e158696b870733

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