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 like to stay logged into my (Ubuntu) VPS as root. Now I am running into issues when I git pull into my wordpress directory at /home/user .

All new files will have user and group assigned as "root", but it will not work in wordpress unless they are owned by "user".

So either wordpress should be able to run with files who have root ownership, or somehow the wordpress directory should automatically chown when I pull. Is it possible?

Is there something I can do, so that I am not forced to always "chown" or "su - user"?

share|improve this question
5  
Stop logging in as root? –  Michael Hampton Aug 12 '12 at 17:26
add comment

1 Answer 1

Its not a good practice to run as root always. Create a non privileged user and use sudo to access root privileges.

Regarding ownership, simplest way is to add a cron job to change permissions every minute. But it is a dirty fix. Use a non privileged user always.

share|improve this answer
    
thanks ya! wonder why this has -2 though...? –  petergus Aug 14 '12 at 18:19
    
Don't know. Share your experience or issues faced if any as comments. –  Anish Sheela Aug 15 '12 at 16:49
add comment

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.