Is it possible to use SFTP on Linux and restrict a user account to ONE directory such that no other directory listing can be obtained? Yes, I must use SFTP, FTP is only used by people that love getting hacked.
For instance I want someone to modify files in /var/www/code/ but I don't want them to be able modify anything else. I don't even want them to see the contents /tmp/.
(I will accept a "quick and dirty" solution, as long as it is secure.)
From sshd_config man-page:
Another alternative could also be to replace their shell with MySecureShell which gives you features such as Chroot, Bandwidth limiting, Connection limiting, etc.. etc..
http://mysecureshell.sourceforge.net/
Using it in a webhosting environment at the moment and must say it's worked out quite nicely.
SFTP is NOT a feature-rich solution comparable to an FTP server like vsftpd. It doesn't support chroots; which is what you are looking for. FTPS (not SFTP) would be the best solution since it supports encryption, chroots, etc. vsftpd supports this and it's easy to setup.
In addition be sure to take advantage of the pam_listfile module to explicitly state which users are allowed to login via ftps.
http://pizzashack.org/rssh/ lets you set up restricted ssh so that only SFTP/SCP are run; it also helps setting up the chroot.
As CarpeNoctem points out, FTPS sometimes is a better solution. ssh, SFTP, scp are very "low-level", FTPS (like the unsafe FTP) are normally higher-level (virtual directories, virtual users, etc.).
I think for the scenario you describe, both approaches would work.
I'd use this config: http://www.debian-administration.org/articles/590
Then, for the chroot functionality: http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny