Once Ubuntu operating system is loaded into the rented cloud hosting, the first job would be to create a user. This new user should have super user privileges.
Current version of Ubuntu : 20.04
By default the super user of ubuntu server is Root and you must have received a system generated password from the cloud hosting service provider. So every time, when you access your ubuntu server through a third party application or command line, a user name and password is required. Root is the top admin. So we must create another user so that if any thing goes wrong then root login save us.
Note: Following guidelines is useful for any cloud hosting or any hosting where you have root access to the server. Such as Digital Ocean cloud hosting, Amazon AWS cloud hosting, VPS hosting, dedicated hosting. If you have root access (that is root as username and password) then you can use following commands.
To access server, we are going to use a desktop application: Putty.
To access Ubuntu server from a local computer such as laptop or desktop, then we can use command prompt (windows) or terminal (Linux) which is bit complex. By using Putty, we can easily access Ubuntu server and make required changes.
Official website: https://www.putty.org/
Download latest version according to your operating system and install it.
Before using putty, you need to know following information.
- IP address of your Ubuntu server (If you are using cloud hosting, once you login you could see the ip address of your cloud hosting.)
- Password for root user (While installing Ubuntu operating system in your cloud hosting, you must have the master password. Either you have created or cloud hosting service provider must have mailed you.)
- Port Number (By default, the port number is 22. If it is not then cloud hosting service provider must have informed you)
Default user name is : root
Login to Ubuntu Server using PUTTY
Once you have gathered above mentioned information, now you are ready to login to your ubuntu server that is hosted in some cloud hosting platform.
Step 01: Launch Putty Application
Step 02: Provide your IP address of cloud hosting in the Host Name or IP Address box and also provide port number in the port number box. (See highlighted section of the image in the above). Then click on open button.
Step 03: Command line console will appear. Here first provide your user name (Which is root by default) and then press enter.
Step 04: It will ask for password. Type your password. Be careful, in Linux operating system such as Ubuntu, it wont show any thing. Once you complete typing your password, then press enter. (If you are copying your password then to paste the password, right click on your mouse.)
If you have provided the right password, then it will show your system configuration and usage details followed with your user name and ready to accept command.
If you are seeing ~ aside to your user name, then it means the user is super user. (In simple words, super user is the admin of the server. Or we can say owner of the server)
Create another user
To stay in safe side, we must create another user and every time we should login with this new user.
Command to create a new user.
test@tester:~$ sudo add user srikant
For new user, you can use any name you want, but it should not contain space or special characters. For this article purpose I am using srikant.
Then press enter.
Now, it will ask for a password. Provide a strong password which is not easy to guess. You can use the help of strong password generator tool.
Then press enter.
It will ask for contact details. You can skip these steps just by pressing enter. (In a company, where so many employees are there, for them, these information are mandatory. But you can skip these steps)
Congratulations! You have just created a new user.
Assign Super User Privileges to the newly added user
Once you have successfully added a new user, its time to assign him powers of a super user or admin of the server.
Command to assign super user privileges to newly added user
test@tester:~$ sudo usermod -aG sudo srikant
Then press enter
Congratulations, you have just assigned all the super user privileges to the newly added user.
Now, either you can relaunch putty and login with new credentials or simply want to switch from root user to newly added user then use following command.
test@tester:~$ sudo su – srikant
Then press enter
You will see your newly added user followed with the server name as above.
Now onward, always login with your newly added user.
Note: while using commands, mark the spaces, hyphens carefully. And also be careful and check twice your typed command before hitting enter. A wrong command can cause data loss, data corrupt, or weird behavior. So always check the command before hitting enter.