In this demonstration, we will create a Linux machine and access the machine with SSL.
Note: Ensure port 22 is open for the connection to work.
- Download the PuTTY tool. This will include PuTTYgen.
- Once installed, locate and open the PuTTYgen program.
- In the Parameters option group choose RSA.
- Click the Generate button.
- Move your mouse around the blank area in the window to generate some randomness.
- Copy the text of the Public key for pasting into authorized keys file.
- Optionally you can specify a Key passphrase and then Confirm passphrase. You will be prompted for the passphrase when you authenticate to the VM with your private SSH key. Without a passphrase, if someone obtains your private key, they can sign in to any VM or service that uses that key. We recommend you create a passphrase. However, if you forget the passphrase, there is no way to recover it.
- Click Save private key.
- Choose a location and filename and click Save. You will need this file to access the VM.
- In the portal create a Linux machine of your choice.
- Choose SSH Public Key for the Authentication type (instead of Password ).
- Provide a Username.
- Paste the public SSH key from PuTTY into the SSH public key text area. Ensure the key validates with a checkmark.
- Create the VM. Wait for it to deploy.
- Access the running VM.
- From the Overview blade, click Connect.
- Make a note of your login information including user and public IP address.
- Open the PuTTY tool.
- Enter username@publicIpAddress where username is the value you assigned when creating the VM and publicIpAddress is the value you obtained from the Azure portal.
- Specify 22 for the Port.
- Choose SSH in the Connection Type option group.
- Navigate to SSH in the Category panel, then click Auth.
- Click the Browse button next to Private key file for authentication.
- Navigate to the private key file saved when you generated the SSH keys and click Open.
- From the main PuTTY screen click Open.
- You will now be connected to your server command line.