How to access your server

If you use windows you can use PuTTy to make a connection to your server ( VPS or Dedicated Server  ) .

This example below use Ubuntu terminal.

Open your localhost terminal with press Ctrl + Alt +  t

:~# ssh root@yourremoteIP
The authenticity of host ‘yourremoteIP (yourremoteIP)’ can’t be established.
ECDSA key fingerprint is SHA256:oqWPHYbSHWQ0TGtNu4Ndxg23/fJ2GfhgUjgGkmo40G0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘yourremoteIP’ (ECDSA) to the list of known hosts.
root@yourremoteIP’s password:
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 3.13.0-147-generic x86_64)

For security reason use root via ssh is not recommend.

Before change file sshd_config you should create a new user to access your server.

Username uses the small character , and change username ” helloiamnewuser” with your own.

:~# adduser helloiamnewuser

Adding user `helloiamnewuser’ …
Adding new group `helloiamnewuser’ (1000) …
Adding new user `helloiamnewuser’ (1000) with group `helloiamnewuser’ …
Creating home directory `/home/helloiamnewuser’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for helloiamnewuser
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
:~# adduser helloiamnewuser sudo
Adding user `helloiamnewuser’ to group `sudo’ …
Adding user helloiamnewuser to group sudo
Done.
:~# cat /etc/passwd
helloiamnewuser:x:1000:1000:,,,:/home/helloiamnewuser:/bin/bash
:~# logout
Connection to yourremoteIP closed.
:~# ssh helloiamnewuser@yourremoteIP
helloiamnewuser@yourremoteIP’s password:
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 3.13.0-147-generic x86_64)
:~$ sudo nano /etc/ssh/sshd_config
Find PermitRootLogin yes and change to PermitRootLogin no
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
After save the file sshd_config ,
 :~$ sudo systemctl restart sshd
:~$ logout
Connection to yourremoteIP closed.
Now try to connect your server use root
:~# ssh root@yourremoteIP
root@yourremoteIP’s password:
Permission denied, please try again.
root@yourremoteIP’s password:
Permission denied, please try again.
root@yourremoteIP’s password:
Permission denied (publickey,password).

 

Another metode to access your server is using key pair  private and public key.