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.
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.
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.
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.
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.
[[email protected] ~]$ ssh [email protected] The authenticity of host '184.108.40.206 (220.127.116.11)' 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 '18.104.22.168' (RSA) to the list of known hosts. [email protected]'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 [email protected] Last login: Thu May 13 09:27:03 2021 from 22.214.171.124 [email protected]:~#
or if you have SSH key then execute following command. Note that
/ssh/newkey.pem is location of your SSH key.
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.