SSH Keys Microsoft Windows
4 minute read
SSH Keys on MS Windows
What are SSH keys?
SSH (Secure Shell) keys are an access credential that is used in the SSH protocol.
The private key remains on the system being used to access the HPCC cluster and is used to decrypt information that is exchanged in the transfer between the HPCC cluster and your system.
A public key file is used to encrypt information, and is stored on your own system. The public key file is stored on the HPCC cluster and contains a list of authorized public keys.
Why do you need SSH keys?
HPCC supports two authentication methods; Password+DUO
and SSH Keys
.
The Password+DUO
method requires a UCR NetID, if you do not have this then you will need to use SSH keys
in order to access the HPCC cluster.
What you need
Filezilla
You will need to install Filezilla
in order to transfer the public SSH key to the HPCC cluster.
- Download the
Filezilla Client
for Windows here. * Make sure your Windows system is updated to the latest version. - Follow the install wizard to complete the install of
Filezilla
.
MobaXterm
You will need to install MobaXterm
in order to generate your SSH keys
and also to transfer the keys to the cluster.
- Download
MobaXterm
fromhere
. - Unzip
- Double click portable version of exe and run the
MobaXterm
application.
Create SSH Keys (MobaXterm
)
Begin by clicking on the tools drop down on the upper menu bar
Find and click on the MobaKeyGen (SSH key generator) option
A window should appear to create a new SSH key. Click on generate to create a new SSH key pair. Follow the on menu instructions.
Once your key has been created, enter a password in the key passphrase field to password protect your key. Click on
conversions
in the tool bar and click onExport OpenSSH Key
. Save this key asid_rsa
and put the file in an easy to access location. Click onSave private key
to save the private key with an extension of.ppk
to use with MobaXterm or FileZilla. Save the key asmobaxterm_privkey
and put the file in an easy to access location.Highlight EVERYTHING in the box labeled “Public key for pasting into OpenSSH authorized_keys file” then right-click on it and choose Copy. Open
Notepad
and paste the copied text. Save the file asid_rsa.pub
and put the file in an easy to access location.
Keys Location
SSH keys should be saved under the location C:\Users\username\.ssh
.
Configure SSH Keys
Public SSH Key
Now that you have created your SSH keys
, and renamed them, you will need to placed the public key (id_rsa.pub
) on the cluster using the cluster.hpcc.ucr.edu
Start the
Filezilla
application.Fill in the
Quickconnect
fields at the top of the application window:- Enter your HPCC username in the
Username
field. - Enter the HPCC servername
cluster.hpcc.ucr.edu
for theHost
field. - Enter your password in the
Password
field. - Enter
22
in thePort
field.
- Enter your HPCC username in the
Click on
Quickconnect
If the next pop up prompts you, then check the box that states
Always trust this host, add this key to the cache
, then click theOK
button.You will need to create a
.ssh
directory to hold your SSH keys. On the right hand side, right click and click on theCreate directory option
under your home folder location.A window will appear to name the new directory. Name should be the following format:
/rhome/username/.ssh
. After naming the new directory click onOK
.Right click on the new
.ssh
directory that has been created. Find and click onFile permissions
.A window with the directory permissions will appear. The
.ssh
directory needs exact permissions in order for it to function properly. Follow the image below to apply the permissions.Now that you are connected to Filezilla transfer your public SSH key from your system by dragging the file
id_rsa.pub
and dropping it into the HPCC cluster direcotry/rhome/username/.ssh/
.
Private SSH Key
Once your public key is in place, now you can configure Filezilla
to use your private SSH key
and connect to the cluster through the secure.hpcc.ucr.edu
server.
Open Filezilla
Site Manager
button in the top bar of icons.Click on
New Site
, rename it (optional) and press enter.Make sure the following fields are correctly filled before adding your
SSH key
file:Protocol
: should be set toSFTP - SSH File Transfer Protocol
Host
: type insecure.hpcc.ucr.edu
Port
: type22
Logon Type
: set toKey file
User
: type in your HPCC username
After these fields are finalized, click the
Browse..
button.Navigate to the folder you saved your private key file in and open the private key file
mobaxterm_privkey.ppk
. You should see the added keyfile in theKey file:
box, then clickConnect
.Subsequnt connections can be done from the
Quickconnect
history by clicking on the down arrow to the right side of theQuickconnect
button. Remember to select thesecure.hpcc.ucr.edu
address.Transfer files by double clicking or drag-n-drop. For more details regarding file transfers vist Filezilla Usage.