I am trying to connect my windows 10 pc with raspberry pi 2 using python script. What I want to do: I want to download the file from windows 10 machine with the help of python Script from raspberry pi. I dont want to use ftp.
What I am doing: I have written the code using paramiko. Below are my code.
import os import paramiko host = "192.168.1.9" port = 22 transport = paramiko.Transport((host, port)) password = "mypassword" username = "myusername" transport.connect(username = username, password = password) sftp = paramiko.SFTPClient.from_transport(transport)
But I am not able to connect only. Its saying connection refused error.
Note: I have connected locally from pi as well as windows means both systems are in same network.
Please help me to resolve this?