FreeBSD FTP tips & tricks

Tue 31 July 2007

Q. Does anyone know if the default ftp server from FreeBSD allow me to give acces to users only for ftp, no shell access to upload files to there home directories?

A. The default ftpd will work with a little tweaking.

    touch /bin/ftpshell
    echo "/bin/ftpshell" >> /etc/shells

When you add your users, set their shell to /bin/ftpshell

    echo USERNAME >> /etc/ftpchroot

The users will be able to login via ftp and nothing else because there shell
is a crap fake shell. The ftpchroot will lock them into their home
directory very effectively.