Nowdays, when working with a freelancer, I add a new user to Debian, create a ftp access to this user and give that to the freelancer

Problem is that freelancer can access some data I want to keep confidential such as: config.php or sqlconfig.php

What would the best strategy so freelancer has some FTP access but cannot access some files (including read them) ?


2 Answers 2


chmod o-rwx on the confidential files and make sure the freelancer is not owner nor group member of the group assigned to the confidential files.


Create a new group, put the www-data user and your trusted dev(s) (ie, you or whovever else), set perms and ownership appropriately. Freelancer could still write code that could fopen() the files (and then display in his browser, whatever) though since the www-data user needs to be able to read the files... If www-data doesn't need to read the files, they don't belong in the webspace.

addgroup www-private
adduser www-data www-private
apache2ctl restart
chmod 640 /var/www/html/privatefile.php
chown trusteddev.www-private /var/www/html/privatefile.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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