Tuesday, January 26, 2010

a FTP account with permission to access multliple folders

SkyHi @ Tuesday, January 26, 2010
FTP itself does not set specific file access restrictions. When a virtual FTP user is created, they are jailed into a specific directory and its subdirectories. To provide access to different directories, you'll need to manually make links for them (as noted above).

To add an FTP account with access to public_html/folder1 public_html/folder2 and /public_html/index.html, first create a folder to use as the root for the FTP account. I'd suggest something like /home/{username}/{ftpusername} (replace {username} and {ftpusername} with the name of the cPanel account user and ftp account user, respectively).

Now to make your links. You'll need to use the 'ln -s' command from the command line as either the account user or as root to set up these links:

ln -s /home/{username}/public_html/index.html /home/{username}/{ftpusername}/index.html

ln -s /home/{username}/public_html/folder1 / /home/{username}/{ftpusername}/folder1

ln -s /home/{username}/public_html/folder2 /home/{username}/{ftpusername}/folder2

Now, when the FTP user logs in, they'll see:


Those will appear to be files but will actually be symbolic links to the real files.