Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a a script to automatically backup my WordPress database and files, and another to restore them over FTP. I'm setting up the FTP server and trying to decide which user to allow FTP access. I know I shouldn't use root over FTP, but is it appropriate to use www-data (the owner of those files)?

Thanks!

share|improve this question
    
If at all possible, use SCP/SFTP instead of FTP. –  danlefree Nov 28 '10 at 5:45

2 Answers 2

up vote 2 down vote accepted

From a security standpoint, it's almost never a good idea to make it possible for a system user (like www-data) to login remotely.

Instead, create a new user specifically to own your Wordpress files. Make www-data the primary group for your user, so that all files you create will be group-owned by the www-data group. As long as your umask is not too restrictive, any files you create as this user should be readable by the www-data group, and thus also visible to the web server.

Finally, I would recommend against using FTP (for a couple of reasons, security being biggest), and instead use SFTP, SCP, or rsync-over-ssh.

share|improve this answer

Create a user specifically for your backup jobs, then add that user to the www-data group. Then ensure that the www-data group has read access to the necessary files.

share|improve this answer
    
Thanks for your answer. What's the benefit of creating a separate user for backups? I'd also need write access to perform automatic restore. –  yayitswei Nov 28 '10 at 2:54

Your Answer

 
discard

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.