# sftp: subsystem request failed on channel 0

## ahuacatlan

Hi,

A few weeks ago, my sftp connection abruptly stopped working. I haven't made any system changes. In desktop sftp clients I get worthless errors, so I tried using sftp in the command line:

```
~ $ sftp user@domain.org

Connecting to domain.org...

user@domain.org's password: 

subsystem request failed on channel 0

Connection closed

~ 
```

SSH works fine.

----------

## causality

In your /etc/ssh/sshd_config (not ssh_config) file, you probably have a line like this:

```
Subsystem sftp /usr/lib/misc/sftp-server
```

If so, it's the cause of this error message.  That's especially true if your sftp user is logging into a chrooted environment, where "/usr/lib" probably does not exist.  My own sftp server is configured this way.

However, SSHD has the sftp functionality built-in and does not need to execute an external "helper" program like that.  So, if you have a line like the above, it can be fixed by changing it to:

```
Subsystem sftp internal-sftp
```

----------

