AZ-900 Microsoft Azure Fundamentals 2020

Sign Up Free or Log In to participate!

Cloud Shell Question

I have created a new Linux machine with the CLI:

az vm create –name linux01 –resource-group 1-123efaasd-sandbox –image rhel –vnet VNET1 –subnet web –public-ip-sku standard –admin-username master –generate-ssh-key

Basically, a vm will be created, but no /home/cloud/.ssh/master.pem file will be created. So, I do not have any chance to log in via SSH. When I create a linux machine from the web console, it works perfectly.

When creating a Windows machine via CLI, I will be prompted to enter a password. This does not happen to Linux.

Do you have any tips?

Any hint will be highly appreciated!



PS: As a feedback, I want to emphasize here that A Cloud Guru is a fantastic opportunity to learn cloud computing. I have seen some harsh criticisms especially in a particular lab for AWS which I can somewhat understand, but would not conclude that it is waste of money. How can I upload a step-by-step description to share with people struggling with some labs?

1 Answers

Hi Yasushi,

Are you still experiencing problems with this Azure CLI command?

I’ve just run some tests in the Cloud Playground, and been successfully able to use the command, in the following way.

Step 1: Create a VNET

az network vnet create --name vnet1 --resource-group XXXX --subnet-name web

Step 2: Create a VM

az vm create --name linux01 --resource-group XXXX --image rhel --vnet-name vnet1 --subnet web --public-ip-sku standard --admin-username master --generate-ssh-key

This should automatically generate SSH keys for you. However if you run into any issues accessing the VM after it is generated, you can always use Azure CLI to reset/update access. For example:

az vm user update --resource-group XXXX --name linux01--username azureuser --ssh-key-value ~/.ssh/

You should now be able to access the VM by typing:

ssh azureuser@PUBLICIPOFVM

Hope this helps!

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?