System administrators and developers frequently connect to Linux servers via SSH (Secure Shell). This method can be automated using a Bash script, saving time and reducing repetitive effort. In this tutorial, we will download and execute a basic Bash script to connect to a Linux server.
Here are the steps to follow:
1. Download and install Git Bash
If you don't have Git Bash already installed on your system, then you can download the application by clicking https://git-scm.com/downloads
2. Go to Azure Portal to complete the following tasks:
[i] search and open Virtual Machine on the search bar
[ii] Create and Select the Azure VM
[iii] Create new Resource Group, give the VM name on Region choose any one from the options.
[iv] On the Image Select Ubuntu Server
, on Authentication type select SSH public key
[v] Give a username on Select inbound ports thick: HTTP (80) and SSH (22)
then Review + Create
.
[vi] Validation passed! then select Create
[vi] Download Private key and Create resource, then return to create VM
[viii] Copy the ip address and open the ip
[vix] Extend the Idle Timeout to 30, Save and exit
[x] Open your Git Bash or Power Shell. I will launch our Git Bash and run the script by typing this command below to connect to our Linux Server but ensure the downloaded key is on Downloads Directory
.
At last, we have successfully logged into our server.
I hope this helps! Thanks; see you later.
Top comments (0)