I am trying to sftp from a Unix box to my computer. I'm use the command:

sftp userid@ipaddr

where "ipaddr" is the IP Address of my computer. But I'm unable to connect.

I tried with ftp and sftpg3, but I'm getting this error Couldn't read packet: Connection reset by peer.

How can I troubleshoot this error?


First, we see some information from man sftp:

     sftp is an interactive file transfer program, similar to ftp(1), which
     performs all operations over an encrypted ssh(1) transport.  It may also
     use many features of ssh, such as public key authentication and compres‐
     sion.  sftp connects and logs into the specified host, then enters an
     interactive command mode.

sftp do all thing over ssh, so if you want to use sftp, you must have a successful ssh connection, in this case, your local machine is a ssh client and remote machine is ssh server.

By default, Windows machines do not have a ssh server, so you can not use sftp with them. You must have a ssh server software install in Windows machine, like winsshd.


SFTP entails communication between two pieces of software. Your sftp command is the client, but there needs to be server software running at the other end as well as network connectivity between you.

Doesn't look like standard Windows ships with SFTP server - the closest is simple FTP in XP Professional.

There are many third-party options however, including free ones. CoreFTP's mini sftp server is a personal favourite for simplicity. Filezilla Server probably wins popularity-wise as the solid (and open-source) choice.

Regarding connectivity, you need to make sure the relevant ports are open at both ends, firewalls allow the traffic, and network configuration (port forwarding etc.) allows communication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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