Skip to main content
Engineering LibreTexts

Secure shell keys

  • Page ID
    31048
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

      Definitions:

      Secure shell keys

      https://www.ssh.com/ssh/public-key-authentication

      Private key and Public key

      https://www.ssh.com/ssh/public-key-authentication#key-pair---public-and-private

      This is what you need to know for the test:

      1. How to generate ssh key pair
      2. Where to put the public key
      3. How to use a private key
       
      Why Secure shell keys?:

      External ssh access to a Google or AWS cloud provisioned servers requires shell keys.

      For Google cloud provisioned server the user generates the key pair and adds the public key to the meta-data in the appropriate location.

      For AWS cloud provisioned servers the key pair is created for the user. The public key is placed in the appropriate location and the private key is made available for the user to collect and use.

      Create your ssh key pair.  The pair consists of a private and public key.  The public key has extension ‘.pub’.  

      Understand single direction and bi-direction of ssh key setup.

      Use bi-direction ssh key setup only at home between servers, or in a server room.

      Avoid having a private key in the cloud or someplace that is not secure.

       

      ssh-keygen -N "" -t rsa -f id_rsa -C yourNameHere

       

      There are two ways to use the private key.  Put it in the default location “.ssh” or explicitly point to the private key when performing the ssh to a server.

      If the private key is located in the default location;

      ~/.ssh/id_rsa

      ssh USERNAME@IP

      If the private key is not in the default location, explicitly point to the key using the ‘-i’ switch.

      ssh -i id_rsa USERNAME@IP

       

       

       

       


      Secure shell keys is shared under a GNU General Public License 3.0 license and was authored, remixed, and/or curated by LibreTexts.

      • Was this article helpful?