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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyssh_util-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c4f41ef0e3d7f5714553130631417ffa88569145b851a4eb22c46bb9c1485d4e
MD5 84183199edd2a77503163cdaff205198
BLAKE2b-256 da80c41765da939544d907900e6d0fda2b1f942d26fb37b4a846d63eed2fcf61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyssh_util-1.0.2-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.3

File hashes

Hashes for pyssh_util-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4212912944522955f7078b6658964e66754102db77d56403cec13bc077a71e7d
MD5 f56d4c14ae37a0389cf2e33100303f18
BLAKE2b-256 5020eac2f8850a365795960d0399d8cc848925c55074b6a79cb00cfcd5938175

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