Infinite | Squares

Art of code and more

Using SSH on Azure Linux VM

Typing password is a time wasting process. It is recommended to use SSH with public private keys to access Linux VM box. To do that in Azure, first you need to create a key pair using following command

1
openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout MyAzure.key -out MyAzure.pem

Then you can :

  • Proceed to create VM in using Azure portal (recommended for beginners and when you don’t need some sort of automation). You need to upload .pem file.
  • Use azure cli to create your VM from command line (advanced user). Details on this available in my gist here

To use SSH key:

1
ssh -i C:\\FOLDER_NAME\\MyAzure.key USER@DOMAIN.cloudapp.net

Comments