0

I'm running an Ubuntu server with apache2/mod_mono

Ive got:

/home/user/www

The only way I've been able to get this all working is by:

chown -R www-data:www-data /home/user/www

I'd like to be able to connect as 'user' using WinSCP and edit the contents of /home/user/www but I've tried all sorts of user and group permissions and cant get it working. I'm sure there are some basics of permissions that I'm not understanding. How should I be doing this?

Tim
  • 199
  • 1
  • 7

1 Answers1

1

Add user to the www-data group:

$ useradd -G www-data user

Set proper permissions on the target folder:

$ chown -R user.www-data /home/user/www
$ chmod -R g+w /home/user/www

The two above commands set the file/directory ownership properly and then grant the group owner write permissions.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • I'd already somehow managed to add the user to www-data group! Thanks – Tim Oct 14 '10 at 13:50
  • isnt it giving 775 for a web root is a security risk? becos we are giving entire group the write access to the web root. – mahen3d Aug 11 '21 at 22:58