Skip to main content

Logging ecs automatic via jumper server

Project description

Login Lumper

License version Codacy Badge Build Status

部署

部署依赖

无pip环境的,请先部署pip(参考命令:sudo easy_install pip)。

  1. 配置pip

sudo mkdir -p ~/.pip/

sudo echo "[global]" > ~/.pip/pip.conf

sudo echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf

sudo pip install --upgrade pip


2.安装虚拟环境

sudo pip install virtualenv

virtualenv --no-site-packages env

source env/bin/activate

部署方式

部署方式,可选择pip安装或下载版本源码。

pip安装

注:请替换'~/Documents/jump-server/'为安装路径


pip install login-jumper --root ~/Documents/jump-server/ --prefix ./


直接下载源码

下载项目发布版本

下载release版本,解压

安装依赖


sudo pip install -r requirements.txt


配置

进入安装路径下的conf目录,修改redis配置


[single] host = 127.0.0.1 port = 6379 database = 2 password = 123456


修改堡垒机配置


[Server]

堡垒机IP

jumper_host = 192.168.1.100

堡垒机ssh端口

jumper_port = 22

[Session]

会话超时时长

alive_interval = 20000000000

[System]

.bash_profile路径

system_profile = ~/.bash_profile


使用

进入路径bin

指定主机参数,运行主程序

请通过-H参数指定需要登录的主机,支持主机名称或IP地址(需登录主机的主机名称或IP地址可登录堡垒机,执行ls命令查看)。如需要登录env3主机:


source env/bin/activate

cd bin/

export JUMPER_PATH=`pwd`

ln -s server_gate.py /usr/local/bin/jumper

export PATH=$JUMPER_PATH:/usr/local/bin:$PATH

alias jumper='python server_gate.py'

jumper -H env3

注意事项

请在堡垒机设置中开启""Usmshell使用命令行方式"

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

login-jumper-1.5.6a1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

login_jumper-1.5.6a1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file login-jumper-1.5.6a1.tar.gz.

File metadata

  • Download URL: login-jumper-1.5.6a1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

File hashes

Hashes for login-jumper-1.5.6a1.tar.gz
Algorithm Hash digest
SHA256 e02636fa8ce801e2e2e83160e28653fb73fa864d5bf65469a35c0c7bc3e831b2
MD5 f6605cb0e7ae06006a4cab091ceb92a6
BLAKE2b-256 c2f2e78316e9621b345d83a83c1aba110f831c030b9bc2b020693839d695d976

See more details on using hashes here.

File details

Details for the file login_jumper-1.5.6a1-py3-none-any.whl.

File metadata

  • Download URL: login_jumper-1.5.6a1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

File hashes

Hashes for login_jumper-1.5.6a1-py3-none-any.whl
Algorithm Hash digest
SHA256 d146a1fa2c34b0c5832963d197e705a0e2cbed01fb70bf603b19ce831b74c754
MD5 b0d5dff4eb10cf62137c2fbe2fef2a58
BLAKE2b-256 308f12a8a3b1a99647601b52053a053b49e0e320153f24fdad274b6579cd8cf0

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