Skip to main content
Engineering LibreTexts

Secure shell keys

  • Page ID
    31048
    • 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