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
```
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
0lever_so-2.0.3.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 0lever_so-2.0.3.tar.gz.
File metadata
- Download URL: 0lever_so-2.0.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2f3366f446ef6830bb7cf7fb670bf10680c73bddfe161f5b747201a8eca36d2
|
|
| MD5 |
9405af6a25713ab313770f56197bd324
|
|
| BLAKE2b-256 |
7a926bd0234e3fb15fbc4045900c83ac83bd3f8518f6a9b25d34da0a623314d4
|
File details
Details for the file 0lever_so-2.0.3-py3-none-any.whl.
File metadata
- Download URL: 0lever_so-2.0.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3da9f979226164cbfe2af707db82f9af4d062efa1c3fe701202519ed1367dd81
|
|
| MD5 |
546ee0d05c62032ddfe355a43c78cbce
|
|
| BLAKE2b-256 |
a168af18ac5f89543390047a5c1713a39bc8f6b843cec2d737e4b62df01fbeb3
|