INLS161-001 Fall 2021

Tools for Information Literacy

Setting up a public key


Why do we need to know this?

Although you will use your ONYEN credentials to authenticate your permissions to use the Opal server, as you move on with your career, you may find yourself in a situation where you need to authenticate with multiple servers. Use of a public key will make this connection much easier to do and much more efficient.
So this will be an explanation of how to create a public key on your client and then move it to a server that has agreed to work with a public key. Opal will continue to require ONYEN authentication.

Steps

  1. Open your terminal (on a Mac)/PowerShell (on a Windows PC) to reach the command line on the client machine.
  2. Change to your home directory using cd ~ Powershell command line
    • In this case, we see that there are .ssh keys available.
    Powershell command line showing .ssh
  3. If you do not have the SSH keys or .ssh directory, generate the keys with this command: ssh-keygen
  4. Copy the contents of your new public key: cat ~/.ssh/id_rsa.pub
    • Highlight and copy the output from this file. Careful to only copy the contents of the file and not your command prompt.
    • Note that you must use 'cat' and not 'more' or 'less' for this to avoid extra newline characters.
  5. Edit your 'authorized_keys' file on the remove server:
    • ssh username@remote_server
    • once logged in at your top (or root) level ...
      • make a new directory using mkdir ~/.ssh
      • Paste in the text you copied in step 4 using nano -w ~/.ssh/authorized_keys
      • Use CONTROL+X to close the file
  6. Set the proper permissions for this new file (still on remote server): chmod 600 ~/.ssh/authorized_keys
  7. Log out of remote server and then attempt to log in. You should be auto logged-in without a password.

back to top

Copyright © R.E. Bergquist 2014- | Last Updated on | Powered by w3.css