Adding an administrative account in Ubuntu

by

in

If, for some reason, no default administrative user was created during the server installation process, the first thing I do is to create a personal user and deactivate the root user, if necessary.

Usually, a pristine Ubuntu installation comes with a default user that was added to the group of sudoers.

However, when acquring a server with my current hoster, root was equipped with a public key for accessing the server via SSH after the setup was completed.

So the first order of business after logging in as root was to create a new user as follows:

adduser <USERNAME>

Replace <USERNAME> with the name of the user (i.e., in my case timo) and follow the onscreen instructions.

In order to enable the user to install software and allow for other maintanance tasks, add it to the group of sudoers with the following command as root:

usermod -aG sudo <USERNAME>

When you are already logged on as another sudo user, you may issue the same command prefixed with sudo.

And that’s all there is to it. Now you can login with your new account and use the sudo command when you must perform maintance or other administrative tasks like installing software for example.

For more details on usermanagement (e.g., how to disable the root user) I highly reccomend the official documentation on the matter.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *