How to Connect to Remote Server using SSH from Windows/Linux

Connecting to a remote server using SSH from Windows or Linux machine is a sort of necessity nowadays for developers. In fact, a normal user who has to manage multiple machines also needs to access another machine remotely. Therefore, learning ways to connect to the remote server is not optional anymore.

In this tutorial we will see different ways and software to connect to remote server.

First of all there are 2 protocols to connect to remote server.

  • SSH for Linux Based Machines
  • RDP for Windows-Based Machines

We will be restricting our discussion in this article to SSH only.

Read: What is Docker?

What is SSH?

SSH which stands for Secure Socket Shell, is a protocol that allows your computer to connect securely to a remote computer/server. After establishing connection you will be able to control remote server, execute commands, install packages and many more.

This is the most preferred and secure way to connect to a remote server for system admin.

Connecting from Windows to Linux Remote Server using SSH

As we discussed above SSH protocol is the only way to connect to Linux based machines. However, Windows doesn’t support any SSH connection. Fortunately, we have many open source software which can establish connection over SSH, once installed in your PC.

Putty SSH Client

Putty is a very popular and lightweight SSH client. It comes as both installer and portable. Therefore, you don’t have to really install it before using. It also supports an SSH key which is very handy. However, Putty doesn’t support .pem format generated by most of the machines. It only support .ppk format. But we do have a solution for that. You will find puttygen on putty download page itself. You can use this tool to convert SSH key from one format to another.

Using Putty to Connect from Windows to Linux

After you have downloaded the putty, it will look like something like this. Now enter the IP address in the box.

putty-ssh-connect-remote-server-liux-windows

If you have SSH key then browse the SSH key location and then click open as follows. If you don’t have SSH key, just click open.

putt-ssh-client

On this screen enter username which could be root, ubuntu, centos, opc and then for password-based login it will ask password as follows. Type it and Voila! You are connected to a remote Linux server.

BitVise SSH Client

Another very useful client to access remote Linux server from PC is BitVise. Bitvise also comes with SFTP which allows secure file transfer from your PC to server. This feature was missing in Putty, therefore you would have required FTP client like WinSCP or FileZilla.

Using BitVise to Connect from Windows to Linux

First of all download BitVise and then open it. You will see window something like as follows.

bitvise-access-server-linux-ssh

Here you have enter IP address, username and password. Or, if you have SSH key, make selection and it will tell you to browse SSH key.

Once you hit Open you will see 2 additional windows popping out, one is terminal and other is SFTP window.

bitvise-connect-remote-server-ssh-windows

Connecting from Linux to Linux over SSH

Connecting from Linux to Linux is super easy. All you need is to open terminal on your Linux machine and execute the following command. Answer yes when asked for confirmation. After that you will be asked for password. Type and hit return.

[david@localhost ~]$ ssh root@209.145.63.221

The authenticity of host '209.145.63.221 (209.145.63.221)' can't be established.
RSA key fingerprint is dc:13:95:72:42:31:14:6d:2d:53:31:6e:ae:d1:10:b3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '209.145.63.221' (RSA) to the list of known hosts.
root@209.145.63.221's password: 
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-143-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Welcome!

This server is hosted by Contabo. If you have any questions or need help,
please don't hesitate to contact us at support@contabo.com.

Last login: Thu May 13 09:27:03 2021 from 49.37.82.193
root@vmi544711:~# 

or if you have SSH key then execute following command. Note that /ssh/newkey.pem is location of your SSH key.

[david@localhost ~]$ ssh -i /ssh/newkey.pem root@209.145.63.221

Conclusion

Connecting to remote server using SSH from Windows or Linux is easy. There’s number of open source SSH client for Windows which make easier to connect to remote Linux server. For Linux to Linux connection we already have terminal on every Linux machine.

2 replies
  1. HASSAN
    HASSAN says:

    On Bitvise when e sidi IP , the user name and finally the.password. It does not connect and.asks.me.via.a.window.to.enter.the.password.again.
    Please explain this problem.

    Sincerely

    Reply

Trackbacks & Pingbacks

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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