服务器登录工具
Project description
======
so
======
This is a SSH login tool
Installation
============
::
pip install --upgrade 0lever-so
or
pip install --upgrade 0lever-so -i https://pypi.org/simple/
Usage
=====
::
# 初始化配置文件,升级无需初始化,chmod 400 ~/.so/keys/*
➜ ~ so_install
➜ ~ cd .so
➜ .so tree
.
├── keys
│ └── demo.pem
└── password.yaml
1 directory, 2 files
➜ .so
::
# 配置文件
ssh:
- id: 1
name: demo1
user: fqiyou
password: xxx
host: 1.1.1.1
port: 20755
- id: 2
name: demo2
user: fqiyou
password: xxx
host: 1.1.1.1
port: 39986
- id: 3
name: demo3
user: root
password: demo.pem
host: 1.1.1.1
port: 22
Other-shell
=====
::
#!/usr/bin/expect
set USER "xxx"
set PASSWD "xxx"
set timeout 10
trap {
set rows [stty rows]
set cols [stty columns]
stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH
spawn su - $USER
expect "Password: "
send "$PASSWD\n"
interact
::
#!/usr/bin/expect -f
set HOST [lindex $argv 0]
set USER [lindex $argv 1]
set PASSWD [lindex $argv 2]
set PORT [lindex $argv 3]
set timeout 10
trap {
set rows [stty rows]
set cols [stty columns]
stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH
spawn ssh $USER@HOST -p $PORT
expect {
"*yes/no" {send "yes\r"; exp_continue}
"*password:" {send "$PASSWD\r"}
}
interact
```
so
======
This is a SSH login tool
Installation
============
::
pip install --upgrade 0lever-so
or
pip install --upgrade 0lever-so -i https://pypi.org/simple/
Usage
=====
::
# 初始化配置文件,升级无需初始化,chmod 400 ~/.so/keys/*
➜ ~ so_install
➜ ~ cd .so
➜ .so tree
.
├── keys
│ └── demo.pem
└── password.yaml
1 directory, 2 files
➜ .so
::
# 配置文件
ssh:
- id: 1
name: demo1
user: fqiyou
password: xxx
host: 1.1.1.1
port: 20755
- id: 2
name: demo2
user: fqiyou
password: xxx
host: 1.1.1.1
port: 39986
- id: 3
name: demo3
user: root
password: demo.pem
host: 1.1.1.1
port: 22
Other-shell
=====
::
#!/usr/bin/expect
set USER "xxx"
set PASSWD "xxx"
set timeout 10
trap {
set rows [stty rows]
set cols [stty columns]
stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH
spawn su - $USER
expect "Password: "
send "$PASSWD\n"
interact
::
#!/usr/bin/expect -f
set HOST [lindex $argv 0]
set USER [lindex $argv 1]
set PASSWD [lindex $argv 2]
set PORT [lindex $argv 3]
set timeout 10
trap {
set rows [stty rows]
set cols [stty columns]
stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH
spawn ssh $USER@HOST -p $PORT
expect {
"*yes/no" {send "yes\r"; exp_continue}
"*password:" {send "$PASSWD\r"}
}
interact
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for 0lever_so-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2386ed3c8da48edf47bb884bc15d6b72666e2e9232d1b3b003852371aa4fe622 |
|
MD5 | 9b6c7780ba70dd0905b7c1c9db9b753b |
|
BLAKE2b-256 | c93d947b2c7b6b18b94c524384463ba255db77e36756c800406f453eac69e5f4 |
Close
Hashes for 0lever_so-1.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2347e28940daf1cd780f767a4b4bc86ba2f1ac79194552221b98cc8425d25a |
|
MD5 | f08b4c47a241be283d1d68c5aba5086d |
|
BLAKE2b-256 | d1bb1f526e72697d8ccd77c7f513ba7d1b23e45642a0ed2bb2dd49f875310c13 |