Skip to main content

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


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.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

pyssh_util-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pyssh_util-1.0.0.tar.gz.

File metadata

  • Download URL: pyssh_util-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyssh_util-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d7e8f63b1bfcf8f1a6f5625375baca7418f2515d7b883b6b501367a448d13270
MD5 d5ef9126447fa3082510686b9d3e18dc
BLAKE2b-256 fdd4d11d64a5380416aa7e64ebe79f143e0ca0039b803ddd8e19320d82c22e0f

See more details on using hashes here.

File details

Details for the file pyssh_util-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyssh_util-1.0.0-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.2

File hashes

Hashes for pyssh_util-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a77959aba5dac36c954cbb6a888e7feefe99270d4d515d181429d25df9a8b03b
MD5 18739f39a561076eff6b1d90cd64453c
BLAKE2b-256 39ac8a6b458294a2f66de018ee7d8b86bafbb4e1ba480ac54b43358e26db3429

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page