Files
shredos.x86_64/support/testing/tests/package/sample_python_scp.py
2026-01-06 22:53:29 +00:00

16 lines
434 B
Python

import filecmp
from paramiko import SSHClient
from paramiko.client import AutoAddPolicy
from scp import SCPClient
ssh_client = SSHClient()
ssh_client.load_system_host_keys()
ssh_client.set_missing_host_key_policy(AutoAddPolicy)
ssh_client.connect('127.0.0.1', username='root')
scp_client = SCPClient(ssh_client.get_transport())
scp_client.get("/etc/hostname", "/tmp/hostname")
assert filecmp.cmp("/etc/hostname", "/tmp/hostname")