Blog Archives

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.

hyper-v.nu

My views on technology

yungchou

witnessing a clear cloudy day

Virtualization and some coffee

My views on technology

Thomas Maurer

Cloud and Virtualization

Cloud Administrator

Begin Your Journey to the Cloud with the Cloud Administrator