From e1b97dcc9d4ad47bf4ceab66466fde2ce895cbe0 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Sun, 15 May 2016 16:17:21 +0000 Subject: [PATCH] Added a file paramikoTest.py, an attempt to make remote connection --- python/paramikoTest.py | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/python/paramikoTest.py b/python/paramikoTest.py new file mode 100755 index 0000000..feae0d7 --- /dev/null +++ b/python/paramikoTest.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 +import paramiko + +ssh = paramiko.SSHClient() +#ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts"))) +ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) +ssh.connect('hostname', username='', password='',port=22,timeout=5) +stdin, stdout, stderr = ssh.exec_command('df -h') +x=stdout.readlines() +sftp = ssh.open_sftp() +#sftp.put(localpath, remotepath) +sftp.close() +ssh.close() +print (x) -- Gitblit v1.9.3