0

I ran a bash command from my azure subscription on portal.azure to create a ssh key and it asked me to give the name of the new file but at a location that I am not able to find on my machine. It gave a default path as /home/username/.ssh/id_rsa I cant seem to find a home directory on my machine. It went ahead and created it but I am so confused as to where it placed it.

Can someone shed some light on this. Do the bash commands run on portal.azure know the file structure of my machine and if it didnt put it under my machine, where did it place it?

ssh-keygen -m PEM -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa):
Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
Sarah
  • 1,199
  • 2
  • 21
  • 42
  • I have a feeling that they are getting created under by portal subscription somewhere but I dont know how or where to get them from. – Sarah Jan 28 '20 at 01:22

1 Answers1

1

When using the bash command line in the Azure portal, it means you use the Azure Cloud Shell, not your local machine. So the SSH key you created is stored in the cloud shell with the path /home/username/.ssh/, not the local machine.

Here is a screenshot that creates the SSH key in the Azure Cloud Shell:

enter image description here

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thank you so very much Charles, how can I access those files in Azure cloud shell, because I need the two files created so I can use them. – Sarah Jan 28 '20 at 17:25
  • 1
    @Sarah Oh, it's easy. You can view them just going to the cloud shell and go to the path `/home/username/.ssh`. – Charles Xu Jan 29 '20 at 01:39
  • @Sarah Any more questions? Does it solve your problem? If yes, please accept it as the answer. – Charles Xu Jan 31 '20 at 01:09