How to use a FUJITSU K5 Key Pair with PuTTY/PSFTP

How to use/convert your K5 Key Pair key to work with Putty

Putty does not natively support the Fujitsu K5 KeyPair PEM file format. In order to use this KeyPair with Putty, it must first be converted to PPK format using the tool PuttyGen. Both Putty and PuttyGen can be downloaded freely from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

  1. Download the ‘puttygen.exe’ file from the above link and save it somewhere suitable
  2. Double click the ‘puttygen.exe’ file to start the application and select ‘Run’ if prompted with a security warning. (Note: There is no installation of this application)
  3. In the resulting window, under ‘Parameters’ ensure ‘SSH-2RSA’ is specified as the ‘Type PSof key to generate’
  4. Under ‘Actions’, click‘Load’. Then in the ‘Load private key:” window, change the file type drop down box to ‘All Files’.
  5. Next browse to and select your K5 Key Pair PEM file and click ‘Open’, then click ‘OK’ to acknowledge any Notice dialog boxes
  6. Click‘Save private key’, then ‘Yes’ to warning about not having a passphrase to protect the key
  7. Next specify a location for the new file to be created, ensuring the same name is used for the PPK file, as was used for the PEM file. (Note: The .ppk file extension is automatically added to the filename). Click ‘Save’ to create the file and to complete the conversion process
  8. PuttyGen can now be closed

How to connect to a Fujitsu K5 Linux VM using Putty

Once you have a Fujitsu K5 Key Pair in PPK format, it can be used to authenticate with K5, using the common SSH client tool – PuTTY.

  1. Download ‘putty.exe’ from the previous link and save it somewhere suitable
  2. Double click the ‘putty.exe’ file to start the application and select ‘Run’ if prompted with a security warning. (Note: Again there is no installation of this application)
  3. In the resulting window under ‘Session | Host Name (or IP Address)’, enter the public facing IP Address of the Linux VM
  4. Next expand ‘Connection | Data’ and enter the username for the VM, that you are wanting to login with i.e. ‘k5user’ for Win/Centos/Red hat & ‘ubuntu’ for Ubuntu. Note: Ensure that the appropriate Security Group and Firewall rules have been opened to allow a SSH connection from your IP Address. Configuration of this is out of scope of this guide
  5. Then expand ‘Connection | SSH | Auth’ and click the ‘Browse’ button, before browsing to and selecting your PPK file and clicking ‘Open’
  6. At this point, it is a good idea to save this configuration so that it can be re-used again. To do this, skip back to the very top category ‘Session’, and under ‘Saved Sessions’ enter a name for this particular connection and click ‘Save’. This saved session will also be used by the file transfer tool PSFTP, (see next section)
  7. Finally, click ‘Open’ to establish the SSH connection

How to transfer files to a Fujitsu K5 Linux VM using PSFTP

PSFTP is another tool that can be used to securely transfer files to and from a K5 Linux VM. In order to successfully authenticate with the VM using a keypair, PSFTP must reference the name of the saved Putty session, rather than an IP Address or Hostname.

  1. Download the ‘psftp.exe’ file from the earlier link and place it in a folder that is included in the system path e.g. c:\windows\system32.
  2. From a Windows command prompt, enter the command ‘psftp’ followed by the name of the saved putty session e.g.
  3. This will authenticate psftp with the VM using the IP Address, username and keypair information saved within the saved putty session.
  4. Now that psftp is connected, it is possible to navigate both the local workstation and remote Linux VM. Proceed each Windows CMD commands with a “!” character e.g. “!dir” – to list the contents of the current directory.
  5. The ‘put’ command can be used to transfer files to the VM, e.g. in the case of Red Hat, this method can be used to transfer the RHUI agent file to the VM.
  6. Once the file is copied to the VM, the psftp session can be closed by typing ‘Quit’.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s