Run python script from windows to access data server via ssh


I am currently working from home, and I have a python script on my laptop that I would like to run, that has to access data from a remote server, that I can access via ssh. Is there a way to do this?

I cannot copy my script onto the server unfourtunately, because there is no disk space on there right now.

>Solution :

I think you should be able to open an SSH connection with paramiko.

import paramiko
ssh = paramiko.SSHClient()
ssh.connect('serveraddress', username='you', password='pass')

# DO python stuff here
# When you need a csv data - example SFTP
# sftp = ssh.open_sftp()
# fpath= '/path/to/data.csv'
# remote_file =
# import pandas as pd
# df = pd.read_csv(remote_file)


Leave a ReplyCancel reply