sftp in a chroot environment
Posted by ark, ,
You can ignore all the code below and just go read this page about setting up a chroot sftp server with the standard openssh, it's built right in now and awesome!

I publish to my blog using sftp. Since I use blogger I had to give them a username and password. I wanted to restrict my exposure so I made a little program that would only run the sftp-server and run it in a chrooted environment, I then set this as the shell for the account. I'm not totally sure it's any more secure, but it makes me feel better.

Getting the files I needed to run a program in a chroot environment was harder than expected, ldd didn't give me all the info I needed, but it was a good start.

Check out the source code. with a README file and even an example of what files you'll need. At least in  Ubuntu 9.10.