0

I'm trying to deploy a website at Digital Ocean. I have the user root as the default. However, since it's root I believe I should create my own, normal user, shouldn't I? Nonetheless, in the documentation they don't say anything about it. Could you guys tell me whether or not I really should create my own user with less privileges?

2 Answers 2

2

If you are neither God nor the Pope, you're not infallible, so prone to make mistakes. ;-) Therefore I would create 2 users:

  1. A user that can read everything but not change anything:

    adduser NormalUserName
    
  2. An "Admin" user that needs the sudo command to change anything.

    adduser AdminUserName
    adduser AdminUserName adm 
    adduser AdminUserName cdrom
    adduser AdminUserName sudo
    adduser AdminUserName dip
    adduser AdminUserName plugdev
    adduser AdminUserName lpadmin
    adduser AdminUserName sambashare
    

    (If any of the above gives an error like group not found, don't worry: I'm trying to be thorough)

Then:

  1. Always log on as the "normal" user
  2. do an su - admin if you know you're going to make just a few changes

Only use root when you know that you're going to:

  • do extensive changes
  • run an long script needing root privileges and that has been thoroughly tested.
  • be needing I/O redirection,...

Additionally, I have a different prompt for the admin and root user (both those show a red prompt whereas the default prompt is a green one) to warn me I'm using the "dangerous" user...

3
  • As you've never accepted an answer on this site before: If this answer helped you, don't forget to click the grey at the left of this text, which means Yes, this answer is valid! ;-)
    – Fabby
    Commented Apr 13, 2016 at 8:04
  • how about downvoting?
    – Oskar K.
    Commented Apr 13, 2016 at 10:49
  • @OskarK.: that's for users who have already accepted answers and reads: Please don't thank me! **;-)** If this answer did help, just click the little grey **☑** at the left of this text right now turning it into beautiful green. If you do not like the answer, click on the little grey down-arrow below the number, and if you *really* like the answer, click on the little grey ☑ *and* the little up-arrow... If you have any further questions, just [ask another one](http://unix.stackexchange.com/questions/ask)! **;-)** >:-)
    – Fabby
    Commented Apr 13, 2016 at 10:53
1

Yes, it's always a very good idea to have an unprivileged account on the system to use when you do not need admin privileges.

On systems with X Window (e.g. KDE, GNOME) this is practically mandatory.

If you have console-only access it is recommended anyway to have it -- even if you're working all the time as admin. In fact, you should block remote ssh login as root for security reasons; ssh instead as this unprivileged user, then run su - to do your admin work.

2
  • how can I create an unprivileged user?
    – Oskar K.
    Commented Apr 13, 2016 at 10:47
  • With the useradd or adduser commands. Do man useradd or man adduser to read the manual pages.
    – dr_
    Commented Apr 13, 2016 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .