I'm trying the following command from the Pi to the PC (

sftp [email protected]:/C:/Users/Desktop/testtest.xml

But I get this error:

ssh: connect to host port 22: Connection refused Couldn't read packet: Connection reset by peer

I've enabled the 22 port in the server (a Windows 10 PC) by allowing inbound and outbound connections through that port. Also, the firewall is off. Any suggestions?

  • Where in the manual did you find that command? Anyhow the question is not Pi specific.
    – joan
    Feb 24, 2020 at 13:21
  • what happens if you simply sftp [email protected] without the rest?
    – papatrexas
    Feb 24, 2020 at 13:28
  • @papatrexas II followed this tutorial docs.microsoft.com/es-es/windows-server/administration/openssh/… and I can get in, but it asks me a password and I don't know which one it is. Any idea? THANK YOU!
    – itd
    Feb 24, 2020 at 16:33
  • This is not a question belonging to Raspberry Pi. I don't believe that you will find much support here to configure a MS Windows PC. You should better ask at MS Windows forum.
    – Ingo
    Feb 24, 2020 at 19:37
  • "but it asks me a password and I don't know which one it is" - what are the choices? My guess is, you'll want the windows 10 users password - do you have a user named pi on windows 10, because that's the user you are trying to authenticate with Feb 25, 2020 at 0:32

1 Answer 1


I followed this tutorial in order to configure SSH in the Windows PC where the files are and then, in the Pi I did:

sftp [email protected]:/C:/Users/Desktop/testtest.xml

The user is the Windows user for login and the IP is the Windows IP too. Then, it asks me for a password and it's the login password to my Windows PC.

  • 1
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Mar 4, 2020 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.