DEV Community

Cover image for [Day 1] Initial login to the server
Wojciech Wernicki
Wojciech Wernicki

Posted on • Edited on

[Day 1] Initial login to the server

Hello guys!

Today is my very first day of my challenge. I'm going to log in to my server for first time and configure all necessary settings: updating server's dependencies and setting up user's permissions.

Update

After logging in, the very first thing you have to do is make sure all dependencies are up to date. For updating in Ubuntu there are two commands:

apt update
apt upgrade
Enter fullscreen mode Exit fullscreen mode

If you're getting error related to permissions, because you're not logged in as root, put sudo before each command.

Optionally, you can remove outdated packages by running command apt autoremove, which I did.

New user

Using root account on daily basis is not the best move as it is the most powerful one on the machine, especially when you want to use it from SSH. I need to create new user that will have administrative rights.

I recommend you to use password manager for keeping your login informations. My first choice for storing passwords for free is KeePass.

To create new user, I typed in:

adduser johndoe
Enter fullscreen mode Exit fullscreen mode

First I entered password and repeated it, then skipped all remaining fields and confirmed them. Second step of creating user is to grant permissions.

usermod -aG sudo johndoe
Enter fullscreen mode Exit fullscreen mode

That's it! For confirmation, I logged in to new account and run sudo reboot now command.


In next post I will talk about securing server by setting up firewall and disable root access from ssh. See you tomorrow!

References


Cover image: Photo by Markus Spiske on Unsplash

Top comments (0)