Creating A Linux VM On Azure With SSH Keys From Ubuntu Machine

Introduction

This article will help you for creating a Linux Virtual Machine on Microsoft Azure with SSH Keys from a base of Ubuntu Machine.

Note

Here I am working with an Ubuntu machine from my side for creating a Linux Virtual Machine on Microsoft Azure.

Requirements

  1. Microsoft Azure account – click here to get a free-of-cost temporary account.
  2. Ubuntu 16.10 Operating System on your machine

Follow the below steps now.

Creating an Ubuntu Server Virtual Machine.

Step 1

Log in to your Azure account using the below link.



Step 2

Follow the below clicks now.

  • New
  • Compute
  • Ubuntu Server 16.04 LTS

Select Resource Manager and Click on Create.

Click on Basics now and enter the below details.

  • Name for the VM
  • VM Disk Type – SSD
  • User name for the VM
  • Authentication Type – SSH Public Key
  • Subscription of your Azure account which you need.
  • Resource Group
  • Location

Creating SSH Key from your Ubuntu machine.

  • Open terminal now – Ctrl + Alt + T
  • Make sure you are a root user now
  • Enter password for your super user account:
  • Generate a SSH key – ssh-keygen
  • Create a new file for saving the ssh key with .txt format (note the location where it is saved)
  • Enter an empty passphrase
  • Confirm a re-entry for passphrase



  • Open your SSH key file now and copy the SSH key, paste it on your Azure portal.
  • Click on OK.


Size Blade

Choose the size of the Virtual Machine that you need now and click on Select in Size blade.



Settings Blade

In settings blade you can find the following options will be configured automatically.

  • Storage
  • Network
  • Extensions
  • High availability
  • Monitoring

Just Click on OK now.



Summary Blade

Once after the validation is passed in the Summary Blade click on OK to create the Linux Virtual Machine.



And now you can find the deployment going on for your virtual machine of Linux.

Note

Look in the below screen a tile of “Submitting Deployment for Ubuntu Server 16.04 LTS”.



Yes!! Here goes your Linuxlearning Virtual Machine now.



Connecting towards Ubuntu Server 16.04 LTS Virtual Machine.

Click on Connect in the VM that we have created.



You will be getting a command as ssh [email protected], use this command to connect towards the Virtual Machine. You should have a SSH client and server component to get connected. Follow the below steps to install it.

  • Open a terminal now – Ctrl + Alt + T
  • Use the command “sudo apt-get install openssh-server” to install SSH component of OpenSSH.
  • Or you can even use Putty for Ubuntu over here. Try downloading with this command - sudo apt-get install putty.