views:

22

answers:

0

I am trying to write a dropbox like system with a linux server and client. So far my java (language chosen randomly) client basically makes calls to unison to sync over ssh.

At this point I would like to add a user account system so multiple people can use the same server, like dropbox. The problem is I am not sure how to support multiple accounts. There are 2 ways I can imagine this working. When a user gets an account for my program...

  1. a new linux user is created. then ssh keys are setup and they sync to that user.
  2. a new user is created in the database of my program and is fully managed through my program.

Option 2 seems like the better choice, maybe I am wrong. But lets say I go with 2. How would this work? I could just make subfolders for each account and sync to those. But that does not seem secure since it would probable not be hard for someone to tweak the name of their directory and get someone else's files.

Ubuntu One uses OAuth, but I dont think that really answers my question.

Any ideas how to go about this?