TurnKey Linux Virtual Appliance Library

Right configuration for multiple domains - User and file permissions setup

I need to use my new small server (WP appliance) to host multiple websites, developed by multiple programmers. So I need multiple users, each user connecting to his own website only.

To test the right configuration, I've added a new user (e.g. 'wp_user') and added it to groups www-data and ssh. I've changed the user's home dirctory to /var/www/wordpress.

Results:

SSH connection from WinSCP was successfull, but the user can't delete files, since they are owned by the webserver. Doing chmod g+w on all files didn't help  - still, the user can't  delete his files.

Analysis:

Files should be owned by the webserver, I've researched the forums and this seems to be the right setup. How can I make sure the user can modify files through WinSCP?

And how do I prevent the user from modifying other domains?

Thanks

Amnon

Resolved

What worked was to setup directories to be group-writable.

All directories to 775:

find /path/to/your/wordpress/install/ -type d -exec chmod 775 {} \;

All files to 664

find /path/to/your/wordpress/install/ -type f -exec chmod 664 {} \;

 

But how to prevent users to access files outside their home directory

Amnon


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)