Installed Ubuntu Server LTS 14.04 from Azure library on Azure VM. Logged in as standard \"azureuser\" created by Azure with my password. Changed root password:
s
I wasn't able to get any of the other answers to work for me, but this answer worked for my case.
For those too lazy to click the link:
ssh -i KEYPAIR.pem ubuntu@HOSTNAME 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'