Professional Documents
Culture Documents
AG4 (B) Generate SSH Keys
AG4 (B) Generate SSH Keys
Cloud (Windows/Linux)
[Edition 01]
support@k21academy.com 1
1 Introduction .........................................................................................................................................................3
2 Documentation Links ........................................................................................................................................4
3 Generate SSH Keys (Public & Private).........................................................................................................5
3.1 Generate SSH Private & Public Keys using PuttyGEN..................................................................................... 5
3.1.1 Download PuttyGen Software .......................................................................................................................................... 6
3.1.2 Generate Keys on Windows Laptop/Desktop ........................................................................................................... 6
3.1.3 Generate SSH Keys on MAC .............................................................................................................................................11
4 Creating an SSH Key Pair on Linux ............................................................................................................ 13
5 SUMMARY ........................................................................................................................................................... 14
support@k21academy.com 2
1 INTRODUCTION
This activity guide cover steps to Generate SSH Keys In Azure Cloud (Windows/Linux) For
Microsoft AZ-103 Training.
support@k21academy.com 3
2 DOCUMENTATION LINKS
support@k21academy.com 4
3 GENERATE SSH KEYS (PUBLIC & PRIVATE)
Note: Steps in this section are applicable only for cloud services for which you need to
connect to Linux Machine on Cloud using SSH
Before you can create Linux instance on Cloud, You must generate SSH Key Pair
(Private & Public Keys) so that you can connect to Linux Machine.
Public Key will be uploaded on Microsoft Cloud Server while private key must be
kept safe with you.
In this section we generate Keys with puttygen (Utility to connect to Unix server)
from and
a) When we create Linux Instance, you provide public key. (It is OK to share Public
Key but never share Private Key)
support@k21academy.com 5
b) Future connection from local Laptop/PC is securily done over SSH and is
Authenticated using Private/Public Key pair.
Depending on operating system of your laptop or desktop (Windows or Mac)
refereresepective section to generate SSH Private and Public Keys.
Note: If you are on Mac then check steps later in this section
2. Click on Generate
support@k21academy.com 6
1. To generate the keys, Click on Generate and hover your mouse around the area
blank area randomly as shown:
support@k21academy.com 7
2. There will be a key generated in the blank box,as shown below.
3. Click on Save private key button to save the private key in your system. Add the key
passphrase (Password) and re-enter it again to confirm passphrase.
4. For public key, first copy and paste the Key content in some other file from the shown
window as sometimes it shows issue while accepting public key file.
5. In that case we can use the copied key content. After that click on Save Public Key to
save the file and save at the same location where you have saved private key in your
system.
Note:We can also save private key without passphrase but for security reasons you
can enter passphrase. (In production you must use passphrase to protect your
private key).
Note: Public key format start with ssh-rsa & end with rsa-key-20190314
support@k21academy.com 8
After generating and saving both the keys, you can go back to the Cloud Portal.
6. The public Key generated is copy and paste in “SSH Public Key” Section on azure
portal.
support@k21academy.com 9
7. This will generate Private & Public Key, Save them to your Laptop/Desktop
Note: Make a note of these two keys as you will need public key in next Activity
Guide.
support@k21academy.com 10
3.1.3 GENERATE SSH KEYS ON MAC
If you are on Mac and using Terminal (and not Putty) then follow
https://www.siteground.com/kb/how_to_generate_an_ssh_key_pair_in_mac_os/
support@k21academy.com 11
Note: Make a note of these two keys as you will need public key in next Activity
Guide.
support@k21academy.com 12
4 CREATING AN SSH KEY PAIR ON LINUX
2) At the prompt, enter ssh-keygen and provide a name and passphrase when prompted.
The keys will be created with the default values: RSA keys of 2048 bits.
support@k21academy.com 13
5 SUMMARY
This completes step by step guide covering:
• Generate SSH Keys Pair for Windows & Linux
support@k21academy.com 14