Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu server and I run an FTP server on it. I changed its folder structure and want to restrict access of users to some of the files not all of them in a way that other files be hidden to users.

How can I do this?

share|improve this question
It depends on ftp server. For example you can use hide_file option in vsftpd server. So which ftp daemon you're running? – rush May 18 '12 at 10:54
Add more information to your question. What FTP server and version are you running? – uther May 18 '12 at 11:14

It's just a matter of permissions. Supposing that your FTP directory is in /srv/ftp, first you should issue these two commands:

find /srv/ftp -type d -exec chmod 755 {} \;

find /srv/ftp -type f -exec chmod 600 {} \;

so that every file can be read and written by its owner only, and every directory can be read and written by its owner only, but can be explored by everyone.

Then, you can proceed in changing the ownership of files and directories. What should be visible through FTP will belong to the user ftp, while the rest will belong to root or any other user that is not ftp.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.