Glutton for punishment: Using Plink to do Key Based Authentication from Windows

Occasionally, it’s good for everyone to question their own sanity. Using the Windows “cmd” command line utility for anything is one of those times. I have nothing against Windows, despite being a Linux administrator, but the command line utility is just, well, awful. It doesn’t resize well, it doesn’t line wrap well, it’s ugly, it’s just all around hard to use.

That being said, if you are a masochist you can use Plink, a utility provided by the same guy who does PuTTY, to do key based authention and remote execution of commands against a NetApp (or any host for that matter).

I’m going to assume you have installed the PuTTY suite of applications. Obviously Plink is required, but we will also need PuTTYgen for this exercise.

  1. First, get your private key. If you have already generated one (like in my previous post), then the simplest way is to show the contents (hint: cat ~/.ssh/id_rsa) and copy/paste them to a text file in a convenient location.
  2. Import the key to PuTTYgen, export it in the .ppk format. Start the utility, then click “Load” and browse to the file you created in step one. It will import the key and you will see something similar to the following:
    netapp_plink_1
    Click the “Save Private Key” button and pick your favorite location (make sure to remember!).
  3. Open a command prompt and enter your hell. Here is how to use Plink to execute commands via SSH from Windows:

    Whew! That’s a lot of typing! Here is what it looks like…
    netapp_plink_2

Leave a Reply