ssh助手
Project description
pyssh_util
- ssh_util.py
ssh到服务器的各种封装方法,使用示例:
host = ''
password = ''
ssh = SSHClient(host, password)
# 执行单行命令
result_single = ssh.execute_command('ls -l')
# 执行多行命令
commands = ['pwd', 'whoami']
result_multiple = ssh.execute_commands(commands)
# 上传并执行脚本
local_script_path = 'C:\\Users\\buyfakett\\Desktop\\1.sh'
remote_script_path = '/root/1.sh'
result_script = ssh.upload_and_execute_script(local_script_path, remote_script_path)
ssh.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyssh_util-1.0.3.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file pyssh_util-1.0.3.tar.gz
.
File metadata
- Download URL: pyssh_util-1.0.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fc83203e51b73b94cf12c01c4be47696b414037c6c31446573aefac0a4c30db |
|
MD5 | 8941cec4cd308511a70215c4b64cf61f |
|
BLAKE2b-256 | d603ffa4393d33a1364c747554da2f490c79c457398f2a82d12690c91646b061 |
File details
Details for the file pyssh_util-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: pyssh_util-1.0.3-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 116803e668895de262c1982324c10f0b09d70003c5225bdc2bed9dd576258eaa |
|
MD5 | f59ab19dd8621bce32943a56b5453a2b |
|
BLAKE2b-256 | d1a05e9e5cf524c6bf43e2a805c0a1e39d1f919714281df70a5ab729a32b399b |