<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>HPCC – SSH Keys</title><link>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/</link><description>Recent content in SSH Keys on HPCC</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/index.xml" rel="self" type="application/rss+xml"/><item><title>Manuals: SSH Keys Summary</title><link>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_simple/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_simple/</guid><description>
&lt;h2 id="ssh-key-basics">SSH Key Basics&lt;/h2>
&lt;p>This &lt;a href="https://hpcc.ucr.edu/manuals/access/login/#ssh-keys">basic introduction&lt;/a> into SSH keys might be sufficient for most users on
all major OSs.&lt;/p></description></item><item><title>Manuals: SSH Keys Apple macOS</title><link>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_macos/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_macos/</guid><description>
&lt;h2 id="ssh-keys-on-macos">SSH Keys on macOS&lt;/h2>
&lt;h3 id="what-are-ssh-keys">What are SSH Keys?&lt;/h3>
&lt;p>SSH (Secure Shell) keys are an access credential that is used in the SSH protocol.&lt;/p>
&lt;p>The private key (ie. &lt;code>id_rsa&lt;/code>) 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.&lt;/p>
&lt;p>A public key (ie. &lt;code>id_rsa.pub&lt;/code>) is used to encrypt information, and is stored on the cluster.
The authorized keys file that is stored on the HPCC cluster (ie. &lt;code>~/.ssh/authorized_keys&lt;/code>) contains one or more public keys (ie. &lt;code>id_rsa.pub&lt;/code>).&lt;/p>
&lt;h3 id="why-do-you-need-ssh-keys">Why do you need SSH Keys?&lt;/h3>
&lt;p>HPCC supports two authentication methods; &lt;code>Password+DUO&lt;/code> and &lt;code>SSH Keys&lt;/code>.
The &lt;code>Password+DUO&lt;/code> method requires a UCR NetID, if you do not have one then you will need to use &lt;code>SSH keys&lt;/code> in order to access the HPCC cluster.&lt;/p>
&lt;h3 id="creating-ssh-keys-from-the-command-line">Creating SSH Keys from the Command-line&lt;/h3>
&lt;p>By far the easiest way to create SSH keys on macOS systems is from the command-line following the instructions
&lt;a href="https://hpcc.ucr.edu/manuals/login/#ssh-keys">here&lt;/a>. Users who prefer to do this in a graphical user interface
can follow the instructions below.&lt;/p>
&lt;h3 id="gui-based-ssh-key-creation">GUI-based SSH Key Creation&lt;/h3>
&lt;h4 id="filezilla">Filezilla&lt;/h4>
&lt;p>You will need to install &lt;code>Filezilla&lt;/code> in order to transfer the public SSH key to the HPCC cluster.&lt;/p>
&lt;ol>
&lt;li>Download the &lt;code>Filezilla Client&lt;/code> for Mac OS X &lt;a href="https://filezilla-project.org">here&lt;/a>.
&lt;ul>
&lt;li>Make sure your Mac OS X system is updated to the latest version.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Follow the install wizard to complete the install of &lt;code>Filezilla&lt;/code>.&lt;/li>
&lt;/ol>
&lt;h4 id="sourcetree">Sourcetree&lt;/h4>
&lt;p>You will need to install &lt;code>Sourcetree&lt;/code> in order to generate your &lt;code>SSH keys&lt;/code> (or use the command line method mentioned &lt;a href="../../../manuals/login/#ssh-keys">here&lt;/a>.&lt;/p>
&lt;ol>
&lt;li>Download &lt;code>Sourcetree&lt;/code> from &lt;a href="https://www.sourcetreeapp.com">here&lt;/a>&lt;/li>
&lt;li>Click on &lt;code>Download for Mac OS X&lt;/code>&lt;/li>
&lt;li>Install &lt;code>Sourcetree&lt;/code>&lt;/li>
&lt;/ol>
&lt;h3 id="create-ssh-keys-sourcetree">Create SSH Keys (&lt;code>Sourcetree&lt;/code>)&lt;/h3>
&lt;ol>
&lt;li>
&lt;p>Open the &lt;code>Sourcetree&lt;/code> application and under the top &lt;code>Sourcetree&lt;/code> menu click on the &lt;code>Preferences...&lt;/code> sub-menu item.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/41.png" alt="fig0">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to &lt;code>Accounts&lt;/code> category and click on &lt;code>Add...&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/42.png" alt="fig0">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &lt;code>Auth Type:&lt;/code> and change the drop down menu from &lt;code>OAuth&lt;/code> to &lt;code>Basic&lt;/code>. Make sure &lt;code>Protocol:&lt;/code> is set to &lt;code>SSH&lt;/code> in the drop down menu.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/43.png" alt="fig0">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Enter &lt;code>id_rsa&lt;/code> in the &lt;code>Username&lt;/code> field.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/44.png" alt="fig0">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click the &lt;code>Generate Key&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/50.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Press &lt;code>Cancel&lt;/code> to exit out of the window.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h3 id="ssh-keys-location">SSH Keys Location&lt;/h3>
&lt;p>By default, your key files are created in the path: &lt;code>/Users/macOSUsername/.ssh/&lt;/code>.&lt;/p>
&lt;p>To verify that the keys were created, do the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Open a new finder window. Click on your home directory on the left side pane.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/23.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Press the 3-button combo &lt;code>Command&lt;/code>+&lt;code>Shift&lt;/code>+&lt;code>.&lt;/code> together (visualized below) to see hidden folders:&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/47b.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>You will now be able to see your &lt;code>.ssh&lt;/code> folder, open it by double-clicking.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/48.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>You should see your newly generated pair of &lt;code>SSH key&lt;/code> files in the folder.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/51.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Sourcetree adds the &lt;code>-Bitbucket&lt;/code> to the end of the &lt;code>SSH key&lt;/code> file names. Remove this by clicking on the file you want to rename and press the &lt;code>Enter&lt;/code> key which allows us to rename the file before the extension.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/52.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>After you have removed the &lt;code>-Bitbucket&lt;/code> suffix from each of the &lt;code>SSH key&lt;/code> file names, your new &lt;code>SSH key&lt;/code> file names should be &lt;code>id_rsa&lt;/code> and &lt;code>id_rsa.pub&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/53.png" alt="fig1">&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h3 id="configure-ssh-keys">Configure SSH Keys&lt;/h3>
&lt;h4 id="public-ssh-key">Public SSH Key&lt;/h4>
&lt;p>Now that you have created your &lt;code>SSH keys&lt;/code>, and renamed them, you will need to place your public key (&lt;code>id_rsa.pub&lt;/code>) on the cluster.&lt;/p>
&lt;p>If you do not have a UCR NetID, or prefer not to use &lt;code>Password+DUO&lt;/code> authentication, then email your public key (&lt;code>id_rsa.pub&lt;/code>) to &lt;a href="mailto:support@hpcc.ucr.edu">support&lt;/a> and skip to &lt;a href="'#private-ssh-key'">Private SSH Key&lt;/a>.
If you already have configured &lt;a href="../../../manuals/login/#passwordduo">Password+DUO&lt;/a> authentication, then proceed with the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Start the &lt;code>Filezilla&lt;/code> application.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Open &lt;code>Site Manager&lt;/code> window by clicking the upper left most button in the top bar of icons.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/60.png" alt="fig60">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &lt;code>New Site&lt;/code>, which will unlock the fields to the right.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/54.png" alt="fig54">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>From the newly unlocked fields in the &lt;code>General&lt;/code> tab, fill in the following:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Protocol&lt;/code>: &lt;code>SFTP - SSH File Transfer Protocol&lt;/code>&lt;/li>
&lt;li>&lt;code>Host&lt;/code>: &lt;code>cluster.hpcc.ucr.edu&lt;/code>&lt;/li>
&lt;li>&lt;code>Logon Type&lt;/code>: &lt;code>Interactive&lt;/code>&lt;/li>
&lt;li>&lt;code>User&lt;/code>: Your HPCC Username&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="../../../img/sshkeys_macos/new_site_general.png" alt="new_site_general">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>When using &lt;code>Password+DUO&lt;/code> authentication, you must also set the maximum number of connections.
Navigate to the &lt;code>Transfer Settings&lt;/code> tab and set the following:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Limit Number of simultaneous connections&lt;/code>: checked&lt;/li>
&lt;li>&lt;code>Maximum number of connections&lt;/code>: 1&lt;/li>
&lt;/ul>
&lt;p>Then click on &lt;code>Connect&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/new_site_transfer.png" alt="new_site_transfer">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>If a pop up prompts you to save your password, select the &lt;code>Save passwords&lt;/code> option, then click the &lt;code>OK&lt;/code> button.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Then enter in your password for the cluster, and click &lt;code>OK&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/connect_password.png" alt="fig">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>If the next pop up prompts you, then check the box that states &lt;code>Always trust this host, add this key to the cache&lt;/code>, then click the &lt;code>OK&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/6be.png" alt="fig8">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>You should now see the &lt;code>DUO&lt;/code> authentication dialog, ensure your &lt;code>User&lt;/code> is correct then enter the number for the preferred option from the list presented, then click &lt;code>OK&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/connect_duo.png" alt="fig8">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Now that you are connected with Filezilla, transfer your public SSH key from your MacOS system by dragging the file &lt;code>/Users/macOSUsername/.ssh/id_rsa.pub&lt;/code> and dropping it into the HPCC cluster direcotry &lt;code>/rhome/username/.ssh/&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/4e.png" alt="fig10">&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>If the &lt;code>/rhome/username/.ssh/&lt;/code> directory does not exits, create it.&lt;/p>
&lt;ol start="10">
&lt;li>Once the &lt;code>id_rsa.pub&lt;/code> file is transferred to the cluster, be sure to rename it to &lt;code>authorized_keys&lt;/code>.&lt;/li>
&lt;/ol>
&lt;h4 id="private-ssh-key">Private SSH Key&lt;/h4>
&lt;p>Once your public key is in place, now you can configure &lt;code>Filezilla&lt;/code> to use your private &lt;code>SSH key&lt;/code> and connect to the cluster through the &lt;code>cluster.hpcc.ucr.edu&lt;/code> server.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Start the &lt;code>Filezilla&lt;/code> application&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Open &lt;code>Site Manager&lt;/code> window by clicking the button in the top bar of icons.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/60.png" alt="fig3">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &lt;code>New Site&lt;/code>, rename it (optional) and press enter.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/54.png" alt="fig3">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Fill in the following fields from the &lt;code>General&lt;/code> tab:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Protocol&lt;/code>: &lt;code>SFTP - SSH File Transfer Protocol&lt;/code>&lt;/li>
&lt;li>&lt;code>Host&lt;/code>: &lt;code>cluster.hpcc.ucr.edu&lt;/code>&lt;/li>
&lt;li>&lt;code>Logon Type&lt;/code>: &lt;code>Key file&lt;/code>&lt;/li>
&lt;li>&lt;code>User&lt;/code>: Your HPCC username&lt;/li>
&lt;li>&lt;code>Key file&lt;/code>: &lt;code>/Users/macOSUsername/.ssh/id_rsa&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Be sure to select the previously created private key (&lt;code>/Users/macOSUsername/.ssh/id_rsa&lt;/code>) for the &lt;code>Key file&lt;/code> field using the &lt;code>Browse...&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/56.png" alt="fig4">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the folder you saved your key file in (default location is &lt;code>/Users/macOSUsername/.ssh&lt;/code>) and open the private key file &lt;code>id_rsa&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/57.png" alt="fig4">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>You should see the added keyfile in the &lt;code>Key file:&lt;/code> box, then click &lt;code>Connect&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/59.png" alt="fig5">&lt;/p>
&lt;p>Subsequnt connections can be done from the &lt;code>Quickconnect&lt;/code> history by clicking on the down arrow to the right side of the &lt;code>Quickconnect&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/61.png" alt="fig5">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Remember to select the &lt;code>cluster.hpcc.ucr.edu&lt;/code> address.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeys_macos/62.png" alt="fig5">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Transfer files by double clicking or drag-n-drop. For more details regarding file transfers vist &lt;a href="some_other_page">Filezilla Usage&lt;/a>.&lt;/p>
&lt;/li>
&lt;/ol></description></item><item><title>Manuals: SSH Keys Microsoft Windows</title><link>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/</guid><description>
&lt;h2 id="ssh-keys-on-ms-windows">SSH Keys on MS Windows&lt;/h2>
&lt;h3 id="what-are-ssh-keys">What are SSH keys?&lt;/h3>
&lt;p>SSH (Secure Shell) keys are an access credential that is used in the SSH protocol.&lt;/p>
&lt;p>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.&lt;/p>
&lt;p>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.&lt;/p>
&lt;h3 id="why-do-you-need-ssh-keys">Why do you need SSH keys?&lt;/h3>
&lt;p>HPCC supports two authentication methods; &lt;code>Password+DUO&lt;/code> and &lt;code>SSH Keys&lt;/code>.
The &lt;code>Password+DUO&lt;/code> method requires a UCR NetID, if you do not have this then you will need to use &lt;code>SSH keys&lt;/code> in order to access the HPCC cluster.&lt;/p>
&lt;h3 id="what-you-need">What you need&lt;/h3>
&lt;h4 id="mobaxterm">MobaXterm&lt;/h4>
&lt;p>You will need to install &lt;code>MobaXterm&lt;/code> in order to generate your &lt;code>SSH keys&lt;/code> and also to transfer the keys to the cluster.&lt;/p>
&lt;ol>
&lt;li>Download &lt;code>MobaXterm&lt;/code> from &lt;a href="https://mobaxterm.mobatek.net/download-home-edition.html">&lt;code>here&lt;/code>&lt;/a>.&lt;/li>
&lt;li>Unzip&lt;/li>
&lt;li>Double click portable version of exe and run the &lt;code>MobaXterm&lt;/code> application.&lt;/li>
&lt;/ol>
&lt;h5 id="persistent-home-directory">Persistent Home Directory&lt;/h5>
&lt;p>By default, MobaXterm will not have a presistent home directory, meaning any files saved there will be lost the next time you start it. To use a persistent home directory, go to &amp;ldquo;Setting &amp;gt; General &amp;gt; Persistent Home Directory&amp;rdquo;. If this shows &amp;ldquo;&amp;lt; Temp Directory &amp;gt;&amp;rdquo;, then change it to where you would like your home directory to be stored on your computer.&lt;/p>
&lt;h5 id="finding-files-on-windows">Finding Files on Windows&lt;/h5>
&lt;p>To find where a file is located on windows from within a MobaXterm terminal, you can use the &lt;code>open&lt;/code> command. For example &lt;code>open .&lt;/code> to open the directory you are currently in, or &lt;code>open ~&lt;/code> to open your home directory.&lt;/p>
&lt;h4 id="filezilla">FileZilla&lt;/h4>
&lt;p>If you choose to upload you SSH key to the HPCC cluster with a &lt;a href="https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/#b-gui-based-ssh-key-creation">GUI app&lt;/a>, you will need to install &lt;code>FileZilla&lt;/code> or a similar sFTP/SCP client.
Note, FileZilla is not required if you use the &lt;a href="https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/#a-command-line-based-ssh-key-creation">command-line approach&lt;/a> below.&lt;/p>
&lt;ol>
&lt;li>Download the &lt;code>FileZilla Client&lt;/code> for Windows &lt;a href="https://filezilla-project.org/download.php?show_all=1">here&lt;/a>.
* Make sure your Windows system is updated to the latest version.&lt;/li>
&lt;li>Follow the install wizard to complete the install of &lt;code>Filezilla&lt;/code>.&lt;/li>
&lt;/ol>
&lt;h3 id="create-ssh-keys-mobaxterm">Create SSH Keys (&lt;code>MobaXterm&lt;/code>)&lt;/h3>
&lt;p>The following provides instructions for both &lt;a href="https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/#a-command-line-based-ssh-key-creation">(A)
command-line-based&lt;/a>
and &lt;a href="https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_winos/#b-gui-based-ssh-key-creation">(B)
GUI-based&lt;/a>
SSH key creation. Users need to choose which option is more suitable for them.
Usually, the command-line based approach is much quicker even for users without
command-line experience since it only requires to copy and paste a few lines
of code.&lt;/p>
&lt;h4 id="a-command-line-based-ssh-key-creation">(A) Command-line-based SSH key creation&lt;/h4>
&lt;p>Creating SSH keys in MobaXterm from the command-line is straightforward and
almost identical to creating SSH keys under macOS and Linux (see
&lt;a href="https://hpcc.ucr.edu/manuals/login/#ssh-keys">here&lt;/a>). To create the SSH key
pair from the command-line, open the MobaXterm
&lt;a href="https://mobaxterm.mobatek.net/demo.html">terminal&lt;/a> and then execute the
following commands. This can be done by a simple copy and paste rather than typing,
and then pressing the enter key. Users who wish to use WinSCP instead of FileZilla
as sFTP client need to follow the key generation instructions of this software as
outlined &lt;a href="https://www.youtube.com/watch?v=EBrtRBI0-k0">here&lt;/a>.&lt;/p>
&lt;pre>&lt;code class="language-sh">mkdir -p ~/.ssh # creates SSH directory
ssh-keygen -t rsa -f ~/.ssh/id_rsa # creates key pair (private and public)
&lt;/code>&lt;/pre>
&lt;p>Next, check the content of the newly created &lt;code>.ssh&lt;/code> directory with &lt;code>ls -al .ssh/&lt;/code>. It should contain files for the private and public keys that are named
&lt;code>id_rsa&lt;/code> and &lt;code>id_rsa.pub&lt;/code>, respectively. Importantly, this private key file should not be shared.&lt;/p>
&lt;p>Note, when using PuTTY (and WinSCP) instead of MobaXterm for generating SSH
keys, then the private key is stored in PuTTY&amp;rsquo;s proprietary key format, which is
indicated by a &lt;code>.ppk&lt;/code> file extension. A key of this format is required when using
PuTTY as SSH client, and it cannot be used with other SSH client tools.&lt;/p>
&lt;p>The public key is the one that needs to be uploaded to the remote system one
wishes to connect to. On the HPCC cluster it needs to be saved in a file
located under this location of your home directory: &lt;code>~/.ssh/authorized_keys&lt;/code>.
The upload can be performed with an sFTP/SCP GUI app like the one built into
MobaXterm or FileZilla (see GUI section below). Copying the key from MobaXterm
into the clipboard (&lt;em>e.g.&lt;/em> in &lt;code>less&lt;/code>) and then pasting it into the
corresponding file opened on the remote system with a code editor like &lt;code>vim&lt;/code> is
another but more advanced option. The following shows how to upload the private
SSH key from the command-line in MobaXterm to the HPCC cluster using the &lt;code>scp&lt;/code>
command, where it is important that users replace &lt;code>&amp;lt;username&amp;gt;&lt;/code> with their own
username on the HPCC cluster. Importantly, only one of the following two
commands should be used. The first one should be used if an &lt;code>authorized_keys&lt;/code>
file does not exist yet, &lt;em>e.g.&lt;/em> when a user configures SSH key accees on the
HPCC system for the first time. The second one should be used to append a new
public SSH key to an already existing &lt;code>authorized_keys&lt;/code> file.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Create new &lt;code>authorized_keys&lt;/code> file&lt;/p>
&lt;pre>&lt;code class="language-sh">scp .ssh/id_rsa.pub &amp;lt;username&amp;gt;@cluster.hpcc.ucr.edu:.ssh/authorized_keys
&lt;/code>&lt;/pre>
&lt;/li>
&lt;li>
&lt;p>Append SSH key to already existing &lt;code>authorized_keys&lt;/code> file&lt;/p>
&lt;pre>&lt;code class="language-sh">scp .ssh/id_rsa.pub &amp;lt;username&amp;gt;@cluster.hpcc.ucr.edu:tmpkey &amp;amp;&amp;amp; ssh username@cluster.hpcc.ucr.edu &amp;quot;cat tmpkey &amp;gt;&amp;gt; ~/.ssh/authorized_keys &amp;amp;&amp;amp; rm tmpkey&amp;quot;
&lt;/code>&lt;/pre>
&lt;/li>
&lt;/ol>
&lt;p>Note, prior to setting up SSH key access both of the above scp commands
require functional password/DUO credentials. Users who do not have password/DUO
access (&lt;em>e.g.&lt;/em> non-UCR users) will need to email their public SSH key to &lt;a href="mailto:support@hpcc.ucr.edu">support@hpcc.ucr.edu&lt;/a> so that the
systems admin can add their public SSH key to &lt;code>~/.ssh/authorized_keys&lt;/code> of the corresponding
user account.&lt;/p>
&lt;h4 id="b-gui-based-ssh-key-creation">(B) GUI-based SSH key creation&lt;/h4>
&lt;p>&lt;font color="red"> Please use the following GUI-based instructions for generating SSH keys at your own risk. The above command-line approach is preferred since it is
much easier and reliable.&lt;/font>&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Begin by clicking on the tools drop down on the upper menu bar&lt;/p>
&lt;p>&lt;img src="../../../img/ssh1moba.png" alt="mobasshkey1">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Find and click on the MobaKeyGen (SSH key generator) option&lt;/p>
&lt;p>&lt;img src="../../../img/ssh2moba.png" alt="mobasshkey2">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>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.&lt;/p>
&lt;p>&lt;img src="../../../img/revisedkeygen.png" alt="revisedkeygen">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Once your key has been created, enter a password in the key passphrase field to password protect your key. Click on &lt;code>conversions&lt;/code> in the tool bar and click on &lt;code>Export OpenSSH Key&lt;/code>. Save this key as &lt;code>id_rsa&lt;/code> and put the file in an easy to access location.
Click on &lt;code>Save private key&lt;/code> to save the private key with an extension of &lt;code>.ppk&lt;/code> to use with MobaXterm or FileZilla. Save the key as &lt;code>mobaxterm_privkey&lt;/code> and put the file in an easy to access location.&lt;/p>
&lt;p>&lt;img src="../../../img/revisedkeygen2.png" alt="revisedkeygen2">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Highlight EVERYTHING in the box labeled &amp;ldquo;Public key for pasting into OpenSSH authorized_keys file&amp;rdquo; then right-click on it and choose Copy. Open &lt;code>Notepad&lt;/code> and paste the copied text. Save the file as &lt;code>id_rsa.pub&lt;/code> and put the file in an easy to access location.&lt;/p>
&lt;p>&lt;img src="../../../img/revisedkeygen3.png" alt="revisedkeygen3">&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h3 id="keys-location">Keys Location&lt;/h3>
&lt;p>SSH keys should be saved under the location &lt;code>C:\Users\username\.ssh&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/sshkeyloc.png" alt="sshkeyloc">&lt;/p>
&lt;h3 id="configure-ssh-keys">Configure SSH Keys&lt;/h3>
&lt;h4 id="public-ssh-key">Public SSH Key&lt;/h4>
&lt;p>Now that you have created your &lt;code>SSH keys&lt;/code>, and renamed them, you will need to placed the public key (&lt;code>id_rsa.pub&lt;/code>) on the cluster using the &lt;code>cluster.hpcc.ucr.edu&lt;/code>&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Start the &lt;code>Filezilla&lt;/code> application.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Open the &lt;code>Site Manager&lt;/code> button in the top bar of icons.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla5.png" alt="filezilla5">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &lt;code>New Site&lt;/code>, rename it (optional) and press enter.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla6.png" alt="filezilla6">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Make sure to use the following settings for the site:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Protocol&lt;/code>: should be set to &lt;code>SFTP - SSH File Transfer Protocol&lt;/code>&lt;/li>
&lt;li>&lt;code>Host&lt;/code>: type in &lt;code>cluster.hpcc.ucr.edu&lt;/code>&lt;/li>
&lt;li>&lt;code>Port&lt;/code>: type &lt;code>22&lt;/code>&lt;/li>
&lt;li>&lt;code>Logon Type&lt;/code>: set to &lt;code>Interactive&lt;/code>&lt;/li>
&lt;li>&lt;code>User&lt;/code>: type in your HPCC username&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Connect&amp;rdquo;. If the next pop up prompts you, then check the box that states &lt;code>Always trust this host, add this key to the cache&lt;/code>, then click the &lt;code>OK&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla3.png" alt="filezilla3">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>You will need to create a &lt;code>.ssh&lt;/code> directory, if it doesn&amp;rsquo;t already exist, to hold your SSH keys. On the right hand side, right click and click on the &lt;code>Create directory option&lt;/code> under your home folder location.
&lt;img src="../../../img/createsshdir.png" alt="createsshdir">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>A window will appear to name the new directory. Name should be the following format: &lt;code>/rhome/username/.ssh&lt;/code>. After naming the new directory click on &lt;code>OK&lt;/code>.
&lt;img src="../../../img/createsshdir2.png" alt="createsshdir">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Right click on the new &lt;code>.ssh&lt;/code> directory that has been created. Find and click on &lt;code>File permissions&lt;/code>.
&lt;img src="../../../img/createsshdir3.png" alt="createsshdir">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>A window with the directory permissions will appear. The &lt;code>.ssh&lt;/code> directory needs exact permissions in order for it to function properly. Follow the image below to apply the permissions.
&lt;img src="../../../img/createsshdir4.png" alt="createsshdir">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Now that you are connected to Filezilla transfer your public SSH key from your system by dragging the file &lt;code>id_rsa.pub&lt;/code> and dropping it into the HPCC cluster direcotry &lt;code>/rhome/username/.ssh/&lt;/code>.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="../../../img/filezilla4.png" alt="filezilla4">&lt;/p>
&lt;ol start="11">
&lt;li>Once the file is transferred to the cluster, be sure to rename &lt;code>id_rsa.pub&lt;/code> to &lt;code>authorized_keys&lt;/code>. Alternatively, if an &lt;code>authorized_keys&lt;/code> file already exists, then you can edit the &lt;code>authorized_keys&lt;/code> file (Right Click &amp;gt; View/Edit) and place the contents of the &lt;code>id_rsa.pub&lt;/code> file inside of it.&lt;/li>
&lt;/ol>
&lt;h4 id="private-ssh-key">Private SSH Key&lt;/h4>
&lt;p>Once your public key is in place, now you can configure &lt;code>Filezilla&lt;/code> to use your private &lt;code>SSH key&lt;/code> and connect to the cluster through the &lt;code>cluster.hpcc.ucr.edu&lt;/code> server.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Open Filezilla &lt;code>Site Manager&lt;/code> button in the top bar of icons.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla5.png" alt="filezilla5">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the HPCC created in the &amp;ldquo;Public SSH Key&amp;rdquo; section&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Change the settings to the following:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Protocol&lt;/code>: should be set to &lt;code>SFTP - SSH File Transfer Protocol&lt;/code>&lt;/li>
&lt;li>&lt;code>Host&lt;/code>: type in &lt;code>cluster.hpcc.ucr.edu&lt;/code>&lt;/li>
&lt;li>&lt;code>Port&lt;/code>: type &lt;code>22&lt;/code>&lt;/li>
&lt;li>&lt;code>Logon Type&lt;/code>: set to &lt;code>Key file&lt;/code>&lt;/li>
&lt;li>&lt;code>User&lt;/code>: type in your HPCC username&lt;/li>
&lt;/ul>
&lt;p>After these fields are finalized, click the &lt;code>Browse..&lt;/code> button.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla7.png" alt="filezilla7">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the folder you saved your private key file in and open the private key file &lt;code>mobaxterm_privkey.ppk&lt;/code>. You should see the added keyfile in the &lt;code>Key file:&lt;/code> box, then click &lt;code>Connect&lt;/code>.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla9.png" alt="filezilla9">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Subsequnt connections can be done from the &lt;code>Quickconnect&lt;/code> history by clicking on the down arrow to the right side of the &lt;code>Quickconnect&lt;/code> button. Remember to select the &lt;code>cluster.hpcc.ucr.edu&lt;/code> address.&lt;/p>
&lt;p>&lt;img src="../../../img/filezilla11.png" alt="filezilla11">&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Transfer files by double clicking or drag-n-drop. For more details regarding file transfers vist &lt;a href="some_other_page">Filezilla Usage&lt;/a>.&lt;/p>
&lt;/li>
&lt;/ol></description></item><item><title>Manuals: SSH Keys Linux</title><link>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_linux/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hpcc.ucr.edu/manuals/hpc_cluster/sshkeys/sshkeys_linux/</guid><description>
&lt;h2 id="ssh-keys-on-linux">SSH Keys on Linux&lt;/h2>
&lt;p>How to create SSH keys on LInux OSs or the command-line in general is described on the general login page &lt;a href="https://hpcc.ucr.edu/manuals/hpc_cluster/login/#ssh-keys">here&lt;/a>.&lt;/p></description></item></channel></rss>