Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have set up a new Debian server on DigitalOcean, where I'm planning to run a Django website.

I have added my ssh key to the server, so I can ssh in as root without using a password. So far so good.

I know I should also have a non-superuser user to run the Django app.

Is it also worth having a third user, that I can use for things like logging in day to day, git pulling and restarting the Django app? Or is that overkill and I can just use root?

share|improve this question

closed as primarily opinion-based by Ward, yoonix, kasperd, womble, HBruijn Aug 19 at 6:50

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

It's a bad habit to use root as your default account. Create yourself a user and if you need to do a lot of stuff as superuser, add yourself to the /etc/sudoers file. –  n1reu Jul 27 at 22:33
One wrong command with root and your whole app is rip –  Michael Bailey Jul 27 at 23:57
I find it useful to have a user with read-only access to the database. The same user can have read access to various logfiles. –  kasperd Aug 2 at 11:57

1 Answer 1

As far as I see:

  1. Have root, then don't use root when you don't need it.
  2. Have a user you log in with. This shouldn't be root, but rather a secure sudoer account.
  3. Go ahead and run your app in a user similar to www-data if you can. It's made when you install your web server. If someone pops a shell on your server, they'd end up with www-data permissions.

What you really have here is a root, admin, and limited user in a sense. I think anything else would be overkill. Programs like ftp need their own user sometimes to function but they also make their own so just don't remove them and properly configure your services to the best of your ability.

As for logging I'm not sure a separate user for that will help. If you're concerned with security massively, consider setting up a separate Syslog server. This way if you get screwed, at least you know exactly how assuming logging is verbose.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.