I saw several threads about having issues with unexpected file permissions after file upload. I tried their solutions with no luck, I have to raise the problem in my way.
I run Nginx as nobody:nogroup
on Debian 6. I changed the root web folder /usr/share/nginx/html
to nobody:nogroup
. Now I use WinSCP to upload file to the machine , but I use root
account. If I create a new directory or update a new file, the ownership would be root:root
. I am new to Linux world, I currently open a shell to change ownership of wwwroot after I have uploaded something to my server.
What is the best practice to upload file as root, but keep files and directories nobody:nogroup
? Shall I set a password to account nobody and use this account to upload files?