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.

On a CentOS server running Plesk, new users are added for each new domain. The users' home directories are in /var/www/vhosts/. New users' home directories are owned by root, and need to have an admin with root access come in and chown them:

dotan@sh2:~$ echo $HOME
/var/www/vhosts/someDomain.com
dotan@sh2:~$ pwd
/var/www/vhosts/someDomain.com
dotan@sh2:~$ touch testFile
touch: cannot touch `testFile': Permission denied
dotan@sh2:~$ ls -la ../ | grep someDomain
drwxr-xr-x 13 root root 4096 2012-08-07 19:47 someDomain.com
dotan@sh2:~$ whoami
dotan
dotan@sh2:~$ chown dotan /var/www/vhosts/someDomain.com
chown: changing ownership of `/var/www/vhosts/someDomain.com': Operation not permitted
dotan@sh2:~$ 

Why might the new users' directories be owned by root, and how might we fix this?

Thanks.

share|improve this question
    
How is the user created? The adduser script should do a chown of the user's home directory. –  jan.vdbergh Sep 3 '12 at 6:16

1 Answer 1

up vote 1 down vote accepted

They are owned by root on my server also. That's a part of the security scheme designed for Plesk. A domain user is allowed to write in some of subfolders (docroots of their sites, cgi-bin, etc), but cannot change general structure of directories. If changed, sometimes this may cause malfunction of your Plesk server.

If you are sure you need these changes and they are safe for you servers, you can probably look at Event Handlers tool of Plesk and code a simple script changing privileges automatically for each new domain

share|improve this answer
    
I see, thanks. That is quite a hack by the Plesk devs, instead of coding Plesk to be more robust on unexpected directory structures, or simply keeping everything important to it in $HOME/.plesk like every other UNIX application. It breaks so many other things (RSA keys, VIM, no .bashrc, etc.). –  dotancohen Sep 3 '12 at 9:59
    
Every other Linux application approach isn't good either. The one has whole $HOME of .xxx and .yyy instead of $HOME/.system/.xxx. –  Sergey L Sep 3 '12 at 10:05
    
Thats why they use .name instead of name: to keep the directories hidden and not bothersome when one just needs to access his own files! I do see your point, though. I think that Microsoft operating systems use your suggested approach, no? –  dotancohen Sep 3 '12 at 10:07

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.