I am fairly new to command line and rPi, all previous experience has been desktop & web apps and have fallen at a major hurdle with my new Pi.

As the title suggests I am struggling to sftp into the rpi with the final intention of controlling GPIO via a web app. most importantly I can log into the pi successfully using SSH terminal for mac.

  1. Pi is connected to router via ethernet and I am running my laptop over wifi
  2. Pi has a static IP, this has been confirmed over router.
  3. Not sure if it was necessary at this stage but port forwarding has been setup on router.
  4. Ran pi updates/upgrades
  5. I have changed my password
  6. PasswordAuthentication yes in /etc/ssh/sshd_config
  7. connection via cyber duck gives this error: Interoperability failure: EOF while reading packet. Please contact your web hosting service provider for assistance.
  8. connection via filezilla gives me this error after previously saying connected: Received unexpected end-of-file from SFTP server.
  9. SFTP connection via terminal: asks me for my password then instantly says connection closed.
  10. Disabling router firewall made no difference so i reenabled.
  11. I was following this tutorial if that helps: tutorial

I have spent the most part of today searching the internet and so far no solutions have fixed my problem.

Being new to command line I am struggling to really delve into the debugging stage and not totally sure what I should be looking for.

edit: I have ran the sftp in terminal with -v

debug1: Authentication succeeded (password).
Authenticated to ([]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2032, received 1680 bytes, in 0.0 seconds
Bytes per second: sent 165392.2, received 136741.6
debug1: Exit status 127
Connection closed
  • digitalocean.com/community/questions/… seems to describe the same problem and offers some potential fixes / workarounds. BTW: I don't have any problems with filezilla / sftp on a Windows machine.
    – Dirk
    Aug 20, 2018 at 7:55

1 Answer 1


Thanks Dirk for pointing me in the right direction! For anyone else with this problem it was fixed by editing /etc/ssh/sshd_config.

Commenting out the line

# Subsystem sftp /usr/lib/openssh/sftp-server

And adding the line

Subsystem sftp internal-sftp

I then power cycled the pi for good measure and voila!

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.