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 am the only one who will have access to my website.

Just installed my VPS and managed to get most stuff working. However, stuck on the "members" part.

Currently, everything has been done as "root".

I have read posts that I should create a user, because root isn't ideal.

I have found thousand guides on how to create a user, but now what to do next.

1- Should I create a user with adduser username and then add the user to a group? But which group?

2- And will the user then be able to do everything as I have done logged on as "root"?

3- And somebody plz explain what "sudo" has to do with this? (if anything at all)

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes, create an everyday user for yourself. You'll use that for everything except for commands you specifically need root access for. For those commands, use sudo. Sudo allows "normal" users to run commands with root privileges, without needing to know root's password or getting a full root shell.

In order to use sudo, you'll need to add yourself to /etc/sudoers. To do this, do the following as root:

$ visudo

Then add the following line:

username ALL=(ALL) ALL

Where "username" is the user you created for yourself. At this point, you'll be able to run commands through sudo. For example:

$ sudo /etc/init.d/apache2 restart

This will run the specified command as root. When you run commands this way, you'll be asked for a password. This is the password of your normal everyday user, not the root password. Many people are confused over this point.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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