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
- Download the ‘puttygen.exe’ file from the above link and save it somewhere suitable
- 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)
- In the resulting window, under ‘Parameters’ ensure ‘SSH-2RSA’ is specified as the ‘Type PSof key to generate’
- Under ‘Actions’, click‘Load’. Then in the ‘Load private key:” window, change the file type drop down box to ‘All Files’.
- Next browse to and select your K5 Key Pair PEM file and click ‘Open’, then click ‘OK’ to acknowledge any Notice dialog boxes
- Click‘Save private key’, then ‘Yes’ to warning about not having a passphrase to protect the key
- 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
- 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.
- Download ‘putty.exe’ from the previous link and save it somewhere suitable
- 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)
- In the resulting window under ‘Session | Host Name (or IP Address)’, enter the public facing IP Address of the Linux VM
- 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
- Then expand ‘Connection | SSH | Auth’ and click the ‘Browse’ button, before browsing to and selecting your PPK file and clicking ‘Open’
- 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)
- 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.
- 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.
- From a Windows command prompt, enter the command ‘psftp’ followed by the name of the saved putty session e.g.
- This will authenticate psftp with the VM using the IP Address, username and keypair information saved within the saved putty session.
- 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.
- 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.
- Once the file is copied to the VM, the psftp session can be closed by typing ‘Quit’.