DEV Community


How to SSH Azure Linux VM

Mohan Sharma
・2 min read

I'm glad to write this post about my experience in connecting linux vm. Below are the number of steps to be taken. Keeping this short and simple.

  1. Create Linux VM on Azure Alt Text
  2. Enable SSH connectivity Alt Text You must enable port 22 for SSH connectivity and create VM with default options. Alt Text
  3. Download Private Key as prompted. It will be .pem file. Alt Text
  4. Once downloaded, VM will be created for you. Go to Virtual Machine-->Settings-->Connect Alt Text

Now here is a twist. People don't know how to use that .pem file downloaded as generally private and public key are contained in id_rsa and files. Also when you will open that .pem file that contains --BEGIN RSA PRIVATE KEY-- AND --END RSA PRIVATE KEY--

The most important thing is that you don't need to copy rsa key between --BEGIN RSA PRIVATE KEY-- AND --END RSA PRIVATE KEY--. You just need to pass path of that .pem file in the last command listed above. Ignore other commands.

You can use powershell or Git Bash cli to SSH Linux VM but make sure to download git BASH cli then only SSH command will be supported in powershell. You you can use any other tool/cli if you want. I prefer powershell and git bash.

Alt Text

Discussion (0)