Using Putty with Grid VMs

Note: Now available on the TF Manual: https://manual.grid.tf/getstarted/ssh_guide/ssh_putty.html

Especially if you’re running Windows, you might want to use Putty to connect to your Grid VMs. This is possible, but the public key must be imported into your profile with care for this to work. Here’s a quick step by step:

Putty Version

For best results, make sure you have the latest version of Putty. Older versions of Putty before 0.75 don’t support the newer SHA-2 based form of RSA authentication and therefore RSA keys won’t work
with the latest versions of popular Linux distributions, by default.

PuttyGen

First run PuttyGen. Even if you already have a key you want to use, this is the best way to get the public key in the proper format. If you don’t already have a key, choose RSA and hit generate. When you’re done, hit Save private key and write the .ppk file to disk. We’ll use this file in the next step to connect.

If you already had a key or want to return to this step later, hit the Load button and select the ppk file. At the top of the PuttyGen window, you’ll see a field with the public key:

image

Copy the public key from this window, making sure you get everything between ssh-rsa and the key comment rsa-key... in this case. Paste that into the ssh public key field in the playground or Terraform file for your deployment. In case of the playground, also save your profile after doing this.

Copying and pasting the public key from your ppk file will not work. There are line breaks in the file that get interpreted as extra information when they get passed to the VM. You might have success removing the line breaks manually, but copying the public key from this gui window is the simplest and most reliable way to make this work.

Connect with Putty

After you’ve added the key to your playground profile or Terraform file, create your deployment. There’s no way to change the SSH key in an existing deployment, you must delete and redeploy. Copy the IP address once the deployment is successful and then open Putty.

In Putty’s config screen, navigate to Connection > SSH > Auth:
image

Hit Browse… and select your ppk file. Then go to Session at the top of the left nav bar and enter your VMs IP address in the Host Name (or IP address) field. Then hit the Open button at the bottom of the window to start your session. When you are prompted for a user name, enter root and you should then get access to a terminal with no password prompt.

If you’re prompted for a password, something went wrong and you won’t be able to log in. Go back and check the steps above, then feel free to post questions or problems in this thread.

2 Likes
4 Likes

Ah nice! I wasn’t aware you had a video covering just this part :+1:

I just made it actually :slight_smile: there’s a wsl aswell in the video gallery update I just shipped

2 Likes

Here’s a summary in case it can help farmers.


SSH with PuTTY

Here are the main steps to SSH into a full VM using PuTTY on a Windows machine.

Note: This guide shows how to deploy a Full VM, but the process is similar with other deployments.

  • Download PuTTY
    • You can download the Windows Installer in .msi format here
    • This will add both PuTTY and PuTTYgen to your computer
    • Make sure that you have the latest version of PuTTY to avoid potential issues
  • Generate an SSH key pair
    • Open PuTTYgen
    • In Parameters, you can set the type of key to RSA or to EdDSA
    • Click on Generate
    • Add a passphrase for your private key (optional)
    • Take note of the generated SSH public key
      • You will need to paste it to the Playground later
    • Click Save private key
  • Deploy a full VM on the Threefold Playground
    • In the profile manager settings
      • Paste your seed phrase
      • Paste the SSH public key generated by PuTTYgen
        • To make sure that you copy the public key in the proper format, after generating the key pair in PuTTYgen
          • Right-click on the window where the public key is presented, select Select All, then right-click again and select copy
    • Deploy a full virtual machine
      • Choose the parameters you want
        • Minimum CPU: 1 vCore
        • Minimum Memory: 512 Mb
        • Minimum Disk Size: 15 Gb
      • Select IPv4 in Network
      • In Node Selection
        • Select Capacity Filter
        • Select Apply Filters and Suggest Nodes
      • Click Deploy
      • Once the 3Node is deployed
        • Take note of the IPv4 address of the full VM
  • Connect to the full VM with PuTTY
    • Open PuTTY
    • Go to the section Session
      • Add the VM IPv4 address under Host Name (or IP address)
      • Make sure Connection type is set to SSH
    • Go to the section Connection -> SSH -> Auth -> Credentials
      • Under Private key file for authentication, click on Browse...
        • Look for the generated SSH private key in .ppk format and click Open
    • In the main PuTTY window, click Open
    • In the PuTTY terminal window, enter root as the login parameter
    • Enter the passphrase for the private key if you set one

You now have an SSH connection on Windows with IPv4.

Placeholder for video to go with above guide, will upload to YouTube and post shortly.

1 Like