# SFTP stopped working



## xy16644 (Jul 13, 2009)

Hello Everyone

I had SFTP working perfectly a few days ago on FreeBSD 7.2 (fully patched) and then when I tried to connect this morning it wouldn't let me.

I checked the following logfile:

/var/log/auth.log

and it has this to say:


Jul 13 17:59:56 sshd[49633]: error: subsystem: cannot stat /usr/libexec/sftp-server: No such file or directory

Jul 13 17:59:56 sshd[49633]: subsystem request for sftp failed, subsystem not found

I can successfully SSH into the server but SFTP fails with the above error. 

I am using Filezilla to test SFTP. I did update Filezilla today with a new version but I find it hard to believe that this would cause SFTP to stop working. I can't SFTP locally on the box either...

Can someone help please as I am unsure how to proceed as a newbie...;-)


----------



## SirDice (Jul 13, 2009)

Check with ls if the file really exists. Also check the permissions of that file. It should have mode 555 (-r-xr-xr-x).


----------



## xy16644 (Jul 13, 2009)

*Not there?*

I just had a look for:

/usr/libexec/sftp-server

and its not there!

Where did it go and how do I get it back? :r


----------



## aragon (Jul 13, 2009)

xy16644 said:
			
		

> Where did it go and how do I get it back? :r



No idea where it went, but to get it back you can try this (as root):


```
cd /usr/src/secure/libexec/sftp-server && make all install
```


----------



## xy16644 (Jul 14, 2009)

Thanks for everyones help!

I managed to get it working again by reinstalling OpenSSH:

cd /usr/ports/security/openssl
make install clean

restarted the sshd service and I was in business again!


----------

