Hello in Cloud Azure Level 1 task 12 I keep failing. I am using the browser terminal to copy public ssh key from root and I am pasting it into authorized keys on vm in root i have also changed permison to 700 for .ssh dir and 600 for full path to authorized keys I checked the file the keys are there but they are both the same and was already in there? Am I using the worng machine? Should I not use terminal and use my own machine pls help.
I don’t have access to your KK Eng task (you should include a review link for it in your question). But if you need to connect to an Azure virtual machine, you can:
- Create the machine in the Azure console
- Ask to create a private key; download it and give it read-user only access (chmod 400 FILE.pem).
- Simple and cheap defaults for attached disk.
- Port 22 open
- Wait for the machine to be provisioned, and get the public IP of the machine
-
ssh -i FILE.pem azureuser@PUBLIC_IP
should get you into the machine.
Again, I don’t have access to the task, so I’m not sure what more you need to do for the task, but that will get you ssh access to the newly created virtual machine.
Hey Rob i added the task info at the top. It keeps failing me even though I am able to ssh in with the ssh keys and my public key is in the authorized_keys for root user on the vm ,see screen shots. Also ssh is allowed on vm port 22 any source.
Okay so the solution for this was that I needed to delete the contents of the authorized_keys file of the root user on the Azure vm and replace it with the public key of the Client host. What I was doing was adding the key to the end of the file instead of replace what was existing.
Hello @rob_kodekloud
I’m able to SSH without the password after copying the ssh key in the authorised_key file, but the system marked it
as wrong.
@rob_kodekloud @dave602 Can you also add the azure client key below the existing key of the VM?
Did you have to do this operation as sudo?
I replaced the key and edited file permissions of the ~/.ssh to 700 and that of ~/.ssh/authorized_key to 600.
This worked, but i want to put a finger on exactly why it didn’t work the first time because the only difference was logging in as root user to perform the same operations.
Hi johnoseiansah,
The task says we need to SSH using the root user. Please try again and setup and connect to the VM as the root user.
Many thanks @raymond.baoly I’ve been able to do it. Was just wondering whether it the file permission change didn’t work because i didn’t log in as root user at the time?
If you weren’t logged in as the root user, you might not have had the necessary permissions to change the file settings or permission.