I have a Linux Debian machine that I own (root access).

I would like to create a new user called "testuser" and give him the right to view, edit and delete files from only one specific folder located in


I do not mind if the user can see which other files exist in /var/www/html/ (or anywhere else). But the user definitely can only view, edit and delete the files contained in the folder /var/www/html/specificfile.

The user ("testuser") isn't created yet.

How do I perform this action?

The user will access the machine only over FTP.

  • Did you look at chroot(8) ? – Vinz Sep 29 '15 at 12:22
  • FTP (The ftp server is already installed on the machine) – S12000 Sep 29 '15 at 12:45
  • The FTP server itself should have a chroot option, that may suit your needs. If you use e.g. openssh's internal sftp, it has that functionality built-in, see ChrootDirectory option. – P.Péter Sep 29 '15 at 14:56
  • Just to be sure, you want to allow FTP access only, right? Allowing FTP access only and allowing command line access would require very different configuration. – Gilles 'SO- stop being evil' Sep 29 '15 at 22:49

Create a hard link to the file... Hard and Soft link reference: The Ultimate Linux Soft and Hard Link Guide | The Geek Stuff

You can approach this several different ways, here might be the two common ways:

  1. Create a directory that the user has access to upon ftp login (users root ftp directory) and created the link there.
  2. Create the link in the users home directory and link the file in the users home directory.
| improve this answer | |

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