1

This was working well until a couple of days ago. I can't recall having done anything to the server leading it to start closing the connection. Also I have no idea what exitcode 128 means, and can't find anything about it. Here's FileZilla's response to the connection attempt

Status: Connecting to foo.bar.no...
Response:   fzSftp started
Command:    open "[email protected]" 22
Command:    Pass: *******
Status: Connected to foo.bar.no
Error:  Connection closed by server with exitcode 128
Error:  Could not connect to server

Trying to connect with WinSCP also tells me the server closed the connection with error code 128 and additionally tells me:

Cannot initialize SFTP protocol. Is the host running a SFTP server?

I can SSH connect to the server no problem using PuTTY. Any ideas?

6 Answers 6

5

It might be an invalid .bashrc file. In my case I found it was referencing another recently deleted script, and so failed.

1

According to this site: http://forum.filezilla-project.org/viewtopic.php?f=2&t=17604, the problem is a bad username/password combination.

2
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. May 24, 2013 at 12:11
  • Not according to that site.
    – d-_-b
    Jul 31, 2013 at 6:43
1

I had the same problem with one domain on my linux RHEL server. (My server requires ssh for security reasons.) I tried changing login and password and everything else.

What finally fixed it was in my WHM control panel, I disabled Shell Fork Bomb Protection. This feature limits ftp connections if there is a lot of traffic on the domain. When I disabled this, the ftp started working immediately and has worked ever since.

It has nothing to do with Filezilla or SCP setup. It is a matter or resources.

See http://docs.cpanel.net/twiki/bin/view/11_30/WHMDocs/ShellFork

0

Since it was working before, have you tried restarting the service? Another thing that you may want to try is using passive mode for your connection. Also, try either resetting the password or creating a new user account (your current account may be locked).

1
  • I've tried rebooting the server and using passive mode. I've also tried changing the password which I don't see why would have worked, since I can log into SSH using PuTTY. Also this is the root account, so how can it be locked? :P
    – Hubro
    Jan 20, 2012 at 2:29
0

Looks like a permissions issue to me. Can your user account access whatever ftp folder your configured to access at login time? Do both you and root (or whatever account is running the ftp/ssh services) have access to your home directory and/or custom ftp directory?

1
  • My user account is root :P In addition, this netstat line shows that root is also running ssh tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN root 3960 1130/sshd.
    – Hubro
    Jan 20, 2012 at 2:31
0

If you are using ssh and scponlyc (chrooted), then you'll need to add the following line to /etc/ssh/sshd_config:

ForceCommand internal-sftp

man sshd_config

ForceCommand Forces the execution of the command specified by ForceCommand, ignoring any command supplied by the client and ~/.ssh/rc if present. The command is invoked by using the user's login shell with the -c option. This applies to shell, command, or sub‐ system execution. It is most useful inside a Match block. The command originally supplied by the client is available in the SSH_ORIGINAL_COMMAND environment variable. Specifying a command of “internal-sftp” will force the use of an in-process sftp server that requires no support files when used with ChrootDirectory.

You must log in to answer this question.

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