Deploy A Linux Vm In Azure & Connect To It Using Ssh
Here's a step-by-step guide on how to deploy a Linux virtual machine (VM) in Microsoft Azure and connect to it using SSH:
Log in to Azure Portal: Log in to your Azure account at Azure Portal
Create a Virtual Machine:
Click on the "+ Create a resource" button on the Azure portal dashboard. Search for "Virtual Machine" and select the "Virtual Machine" option from the search results.
Basic Settings:
Choose your subscription. Create or select a resource group to organize your resources. Enter a virtual machine name. Choose a region for deployment. Select a Linux distribution (e.g., Ubuntu, CentOS, Debian) from the "Image" options.
Administrator Account:
Under the "Administrator account" section, enter a username for the VM. Choose SSH public key authentication, and either paste your SSH public key or upload the key file.
Settings: Configure optional settings such as disk, networking, and management. Open port 22 (SSH) in the inbound port rules to allow SSH traffic.
Review + Create: Review your VM configuration. Click the "Create" button to start the deployment process.
Wait for Deployment:
Azure will deploy the VM based on your settings. Wait for the deployment to complete.
Get Public IP Address: Once the VM is deployed, go to the VM's details page. Note down the public IP address of the VM.
Connect Using SSH: Open your local terminal or command prompt on your computer. Use the SSH command to connect to the VM: ssh username@public_ip_address If you're using an SSH key, you might use a command like ssh -i path/to/private_key.pem username@public_ip_address
Authentication: If you used SSH key-based authentication, the private key will be used for authentication. If you're using a username and password, you'll need to enter the password you've set during VM creation
SSH Session: Once authenticated, you'll have access to the Linux terminal of the virtual machine. You can run commands on the VM just like you would on a local machine. That's it! You've successfully deployed a Linux VM in Azure and connected to it using SSH.
Note:
Always remember to shut down your VM when is not in use or delete it when you no longer need it to avoid overcharge. But if you still need to use the VM in the feature shut down and also disassociate the IP address.
Subscribe to my newsletter
Read articles from Jones A Jones directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Jones A Jones
Jones A Jones
I am a Computer support Engineer