If you want to give ftp access to a certain subdirectory on your Linux box, but restrict that user from being able to read anything else on the filesystem you can do so using proftpd
Download the tarball and extract the archive
curl ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.2.tar.gz | tar xz
Now it’s the standard ./configure, make, make install routine
After installing open the config file. On Redhat you will find it at /usr/local/etc/proftpd.conf
Uncomment the line #DefaultRoot ~
This will cause your users to be “jailed” into their home directory, any other directory can be specified here if desired
Make note of the User and Group values, these will need to exist on your system for the server to start
Also note the setting Limit SITE_CHMOD which is set to DenyAll by default, this will keep ftp users from being able to change file or directory permissions
Remove or comment out all lines in the Anonymous section to prevent anonymous ftp connections
Save and exit the config file. You should now be able to start the ftp server
/usr/local/sbin/proftpd
You should be able to log in with any local account username and password, and your home directory will be listed. You should not be able to CD to the parent directory or any other directory outside of your home directory.
Now, the purpose of setting up a ftp in this manor is to restrict access to the rest of your filesystem. If you create Linux accounts for ftp users they will by default have shell access to the server. The following steps will allow you to deny shell access to the user while still allowing them to log into the ftp server.
Create a file called /bin/ftpaccess with the following contents
#!/bin/bash
echo "This account is for ftp access only"
Give the file execute permissions
chmod a+x /bin/ftpaccess
Add the file to your list of shells, usually found at /etc/shells
Change the user’s default shell to your newly created “shell”
usermod -s /bin/ftpaccess ftpuser
This user should not be able to log into the shell either locally or via SSH/telnet