sshcec/tester.py

23 lines
764 B
Python

import paramiko, os, subprocess, interactive
sshClient = paramiko.SSHClient()
sshClient.set_missing_host_key_policy(paramiko.AutoAddPolicy())
sshClient.connect('linux-lab-055.ece.uw.edu', username='hyu3', password=':Eric200002182919')
# ssh_stdin, ssh_stdout, ssh_stderr = sshClient.exec_command("/homes/hyu3/anaconda3/envs/Documents/bin/python /homes/hyu3/Documents/dummy.py")
# print(ssh_stdout.readlines())
#
# ssh_stdin, ssh_stdout, ssh_stderr = sshClient.exec_command("a")
# print(ssh_stdout.readlines())
#
# ssh_stdin, ssh_stdout, ssh_stderr = sshClient.exec_command("b")
# print(ssh_stdout.readlines())
channel = sshClient.get_transport().open_session()
channel.get_pty()
channel.invoke_shell()
interactive.interactive_shell(channel)
sshClient.close()