Connect to a remote system using RDP or SSH in 5 simple steps
5 min read
Hello, It's Kandy Here. While humans are actively welcoming Industry 4.0, We will be seeing a major shift in work culture all around the world. The world is more dependent on technology, especially the cloud infrastructure provided by top companies such as Alibaba Cloud, Amazon Web Services (AWS), Google Cloud Platform (GCP), IBM Cloud, Oracle Cloud, Microsoft Azure, and more. The need for the future is flexibility and productivity with the least effort and cost. So cloud Infrastructure helps businesses of all kinds and sizes to scale globally at a minimal cost. As the need and dependency are growing on the cloud, It is fair to say that in future there will be lots of remote job opportunities and working remotely will become a very good choice for businesses and even employees.
To adjust to a fast-changing environment, there is a need to learn new things that are ahead of us. One of those things is SSH and RDP. So to be able to connect to our remote systems and get the work done, let's get started!
What is SSH?
SSH stands for secure shell. SSH is a protocol for securely accessing a remote system over a network. SSH protects the privacy of users and provides integrity. Today It runs on practically every server across the globe. It comes preinstalled on UNIX, Linux, mac and it is used in over 90% of all data centres in the world.
What is RDP?
RDP stands for Remote desktop protocol. RDP is a secure network communications protocol developed by Microsoft. RDP also allows users to access remote systems over a network.
Difference between SSH and RDP
- RDP provides GUI (Graphical user Interface) while SSH only has CLI(command line interface)
- RDP uses port 3389 by default while SSH uses 22.
- SSH demands technical skills while RDP is easy to use.
Today we have lots of options such as AnyDesk, team viewer, teams and a lot more that allow us to access remote systems via Windows system but most of these applications might not be cross-platform or very much compatible or usable across various platforms. Cloud platforms like Azure and more provide you with an option to connect with remote virtual machines majorly Via SSH or RDP by default. so Let's try connecting with a remote virtual machine.
Let's Connect to our remote system
Let's create a virtual machine on Azure so we can connect to a server hosted remotely. Here, I am creating a virtual machine and allowing inbound ports RDP (3389) and SSH (22). If we won't open inbound ports in our system's firewall then we won't be able to connect to our server and it does make sense. Because Our server needs to be secure and so It is not recommended to keep these ports open and only do it when it is necessary. Even though It is still very much secure but now the Server is only as secure as your credentials. So it becomes necessary to keep your username, password or private keys safe. As you can see our VM is up and running. So let's check if we have the required ports open.
To check If we have the required ports open, visit the Networking tab in the side menu. here I am adding an inbound rule for RDP on port 3389. This is necessary if you want to connect via RDP. And so you can do the same for SSH but it's not needed in our case as we already have an inbound rule for SSH. The yellow warning symbol tells us that it's not preferred to keep the SSH or RDP port open, So close them when they are not in use.
To know your virtual machine's public IP Address, Click on connect tab or overview tab. Though the connect tab provides you with all the information that you will need to connect to the machine and the functionality to download files such as RDP files which helps you to connect to the system in a few clicks. Let's download the RDP file as well so we can connect using RDP later.
Let's connect to our Virtual machine. Open a terminal (Bash shell on Linux) or putty on windows (there are more options now as now we have Windows Subsystem for Linux but this is completely your choice). Type
ssh username@ipaddress. It will prompt you to enter your password and whether you want to continue connecting. Enter yes to confirm. As you can see I am able to connect to the remote server. To close the connection, All you have to type is
exit, And the connection will be terminated. Notice that my username and system name changes when I connect or disconnect to the virtual machine.
Let's connect to our VM using RDP. Remember that we downloaded an RDP file right? All we need to do is to double click on that file to open a connection or you can press windows + R > type mstsc and press enter to run the Remote desktop client in windows. For Linux too, you double-click the file to open the connection. Though You also need a remote desktop client such as Remmina which I personally use (It's also free and open source). On Double-clicking the file with Remmina installed, we can see the following window: Notice how the port is 3389 which tells us that the connection is indeed RDP. Here we see a server manager screen, But it's not our concern in this blog. It just helps you configure the server as the OS we chose for our VM is specifically made for servers.
So In 5 Simple steps, We learned how to create Virtual Machines, Open inbound ports to establish connections, And connect to our Virtual machines using Client Applications. Cloud today is a necessity and being aware of the possible solutions can help you build major applications and save costs. I hope you learned something new and If so, press the follow button because there will be more interesting topics that we will cover.