Login to your VPS with a username and password
Normally you log in to your VPS with an SSH key. If you want to log in with a username and password instead, follow the steps below.
Adding a username and password
- Connect to your VPS via SSH
ssh ubuntu@123.123.123.123
- Add a new user
You will be prompted twice to set a password. Click here to generate a secure password. You can leave the answer to the remaining questions blank by clicking ‘Enter’.# adduser jan
Adding user `jan' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Answer the question “Is the information correct?” by pressing “y” followed by “EnterChanging the user information for henk
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y - Now add the created account to the sudo group
usermod -aG sudo username
Allow password login on your VPS
By default, you are not allowed to log in to your VPS with a username and password. Follow the steps below to change this.
- Connect to your VPS via SSH
ssh ubuntu@123.123.123.123
- Open the file /etc/ssh/sshd_config
vim /etc/ssh/sshd_config
- Adjust the next line
to:PasswordAuthentication no
PasswordAuthentication yes
- Save the file with the key combination
:wq
- Finally, restart SSH to make the change active
sudo service ssh restart