I'm new to Azure, sorry if my question sounds dumb.
I use ssh-keygen
to create public/private key pair in cloud shell, but where is my local location this private key get saved to? I wasn't prompted to provide a local path for storing this private key, so is the private ket get stored in Azure?
Asked
Active
Viewed 1.2k times
3

Nancy
- 26,865
- 3
- 18
- 34
-
If you use the Azure CLI to create your VM, you can optionally generate SSH public and private key files by running the az vm create command with the --generate-ssh-keys option. The keys are stored in the ~/.ssh directory.The public key is placed on your Linux VM when you create the VM.The private key remains on your local system. Protect this private key. https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-ssh-keys-detailed#:~:text=If%20you%20use%20the%20Azure,ssh%20directory. – SumanthMarigowda-MSFT Sep 07 '20 at 17:11
1 Answers
1
When you use ssh-keygen
, by default, the key pair was saved to the directory /home/user/.ssh
on the Cloud Shell. You can download the files to your local machine via clicking Upload/Download files
or persist files in Azure Cloud Shell.
For more information, read Overview of Azure Cloud Shell.

Nancy
- 26,865
- 3
- 18
- 34