-2

Greetings,

I've been using Dropbox on Ubuntu 10.04 and while initially it was working very well for synchronizing a local copy of my website with the remote site, it didn't do so well when it came to preserving file ownerships and file permissions (this is particularly important for my shell scripts and java applications that need www-data file ownership)

I've tried Unison, but again, this seems to just download all the files and give them my username's ownership and 755 permissions.

Anyone with experience in these matters got any suggestions?

Is a distributed filesystem what I need? Hadoop or something?

Also, is it possible to get the synchronization to run automatically every time a file is changed on either end?

Also, it would be really nice to be able to go "back in time" a la Dropbox. Is this possible? Would I need some kind of version control system/distributed filesystem? If yes, any recommendations?

Eamorr
  • 596
  • 5
  • 13
  • 27

2 Answers2

0

The process which is writing the files, needs to run as root if its going to create/update the filse as a different user. Its good practice to disable root logins via ssh - so that implies pulling the files as root rather than pushing them to a root login however that pre-supposes that replication is one-way for 2 way replication across the internet you probably want a more esoteric configuration of your ssh server, e.g. running on a non-standard port, disabling password authentication and only allowing keypair auth, using port-knocking, fail2ban etc.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • Hi, thanks for the response. I tried root login, but security issues arise if dropbox syncs as root. Do you reckon I could add the www-data user to my username's group to achieve Dropbox synchronization? Like this http://serverfault.com/questions/178601/permissions-problems I've tried adding www-data to my username's group in /etc/group, but it doesn't seem to be working... – Eamorr Oct 21 '10 at 21:49
  • Essentially you're at deadlock - only root can manipulate permssions on other peoples files - and you can't login as root. You'll need to redsign your permissions model. – symcbean Oct 22 '10 at 10:52
0

Solution:

On my laptop, I've added the user 'www-data' to /etc/init.d/dropbox and restarted dropbox.

Here is the line in question:

DROPBOX_USERS="joe90 www-data"

Now files from my 'joe90' (my username) and 'www-data' are synchronised. The files on my laptop are all owned by 'jo90' on my laptop regardless of wether they are owned by 'joe90' or 'www-data' on my server.

Hope this helps someone.

Eamorr
  • 596
  • 5
  • 13
  • 27