I'm trying to connect by sftp from client-linux to Server. When I'm trying to connect from bash with sftp -v -oPort=22 username@SERVER I get:

Received disconnect from IP_OF_THE_SERVER: 11: Application error
Couldn't read packet: Connection reset by peer
Running in verbose mode I get the following:
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to SERVER.IP [SERVER.IP] port 22.
debug1: Connection established.
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_rsa type 1
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_rsa-cert type -1
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_dsa type 2
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_dsa-cert type -1
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_ecdsa type -1
debug1: identity file /opt/PIREFTP/pireftp/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version mod_sftp/0.9.8
debug1: no match: mod_sftp/0.9.8
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
Received disconnect from 11: Application error
Couldn't read packet: Connection reset by peer

I don't understand why it tries to connect by keys, I want to be prompted for a password. I even tried running with -o PubkeyAuthentication=no parameter and still fails. If I'm connecting from my iPhone with FTPManager client, I succeed to connect.

  • -oPort 22 without a space after "-o" will generate some sort of error, but probably would drop back to commandline. Assuming that's a typo, you don't need to specify the port, 22 is the SSH default port. SFTP uses FTP over SSH. Try with ssh -v username@SERVER.
    – Jeter-work
    Jan 23, 2018 at 21:38
  • "mod_sftp/0.9.8" This is apparently ProFTPD's SFTP module? Your client debug trace just says that the server is abnormally closing the TCP connection. You should check the proftpd logs on the server to troubleshoot why that is happening.
    – Kenster
    Jan 23, 2018 at 22:00
  • the problem is I don't have root access to the server. I only have 1 ftp account to send files.
    – catalin
    Jan 24, 2018 at 10:56

1 Answer 1


Seems like the sftp -F /dev/null -o PreferredAuthentications=password user@host is prompting me for a password.

  • Yes, -o PreferredAuthentications=password tells it to use password authentication for the ssh connection. Not sure why you're trying to load a null config file.
    – Jeter-work
    Jan 23, 2018 at 21:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .