Configure new SSH authorization key for Linux on Azure

If you would like to use SSH with Linux virtual machines on Azure, there is a great documentation here. One question I have seen in the forum, which is not clearly explained in the documentation is, how do we add a new SSH authorization key, if we missed adding the SSH file, during the creation of virtual machine.

Giving the steps I have followed to setup a new SSH authorization key below:

Step 1: I created a Linux VM (Ubuntu 14) on Azure using quick create VM (linuxvmforssh.cloudapp.net).

Step 2: Executed following commands from Git shell on my Windows 8.1 laptop

GIT> ssh-keygen -t rsa -b 2048 -v -f azurecert.key
	
GIT> scp azurecert.key.pub azureuser@linuxvmforssh.cloudapp.net:/home/azureuser

GIT> ssh azureuser@linuxvmforssh.cloudapp.net

azureuser@linuxvmforssh:~$ cat azurecert.key.pub >> .ssh/authorized_keys

azureuser@linuxvmforssh:~$ sudo service ssh restart

azureuser@linuxvmforssh:~$ exit

GIT> ssh -i azurecert.key azureuser@linuxvmforssh.cloudapp.net

Hope this helps you to setup new SSH authorized keys for your Linux virtual machines.

About Manesh

Manesh is a software consultant and solutions architect specializing in cloud, data, Linux and devops in the azure realm with key focus on hybrid workloads. He has been working on Azure technologies since its inception and has helped many enterprises to onboard and adapt to Azure cloud, build solutions for datacenter scale / high consumer applications and services. Currently, he is Microsoft certified for Developing Microsoft Azure Solutions (70-532), Implementing Microsoft Azure Infrastructure Solutions(70-533) and Architecting Microsoft Azure Solutions (70-534).

Posted on 2015/02/24, in Microsoft Azure and tagged , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

https://hyper-v.nu/

My views on technology

Virtualization and some coffee

My views on technology

Thomas Maurer

Cloud and Datacenter Blog focusing on Microsoft Azure

Cloud Administrator in Azure World

Begin Your Azure Management Journey with the Cloud Administrator

%d bloggers like this: