100 days of cloud Azure - day 13

I am unable to complete Day 13: SSH into an Azure Virtual Machine. Can you please guide me with the steps required to complete it. I tried multiple times trying to copy the SSH public key to the “authorized file” but I am facing a permission issue.

I think I am able to SSH now. But still this task failed. Please confirm.

Hi @MrSampath

Please refer to the solution here:

and compare it with your steps.

1 Like

Thanks Raymond.

I am still getting error. Please check the attached screenshot and advice.

Thanks @MrSampath

I’ll check it and get back.

@MrSampath

It is valid issue, I’ve forwared to the team to check and update it.

1 Like

I have also facing the same issue, I have completed the task and able to ssh with root user without password. But task given error on submission.

This one’s actually quite quick and easy:

  1. Get a resource group for the azure-client’s account: az group list
  2. Now use this command to get a public IP for our vm (say, xfusion-vm): az vm list-ip-addresses -g kml_rg_main-FROM-1 -n xfusion-vm
  3. Get the public key for our azure-client: cat ~/.ssh/id_rsa.pub
  4. ssh as azureuser to vm: ssh -i ~/.ssh/id_rsa azureuser@PUBLIC-IP
  5. Become root: sudo -i
  6. The /root/.ssh/authorized_keys` file has previous content – remove that and paste in the public key from the azure-client terminal from (3).
  7. exit the vm.
  8. test the vm by doing ssh -i ~/.ssh/id_rsa root@PUBLIC-IP.

That will pass the grader.

2 Likes

Thanks @rob_kodekloud

@Parveenrohilla

Please try again using Rob’s solution. I’m able to pass the task with it.