0

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) ?

Regards

yarek
  • 797
  • 4
  • 12
  • 21

2 Answers2

1

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.

anneb
  • 206
  • 1
  • 8
0

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
ivanivan
  • 1,448
  • 6
  • 6