Using Authorisation Keys to log in

Creating Keys

If you log into other machines often, and you get fed up with entering your password every time you do, you want a SSH key which takes the place of your password
Below are the steps you require to create one on our systems

  1. Open a terminal and type
    $ ssh-keygen -t rsa
    This will generate the key pair
  2. You will be prompted where to save the new key, the default is what we need so just press enter
  3. Next you're asked if you wish to set a pass phrase, a short password used to protect the key, (this is optional for no pass phrase just hit enter)
  4. And the same pass phrase again to check for typos
  5. You will now be returned to the terminal, the next step is to add your new key to the authorized_keys2 file.
    As you do not currently have any keys, this can be done by typing the following command
    $ cp .ssh/id_rsa.pub .ssh/authorized_keys2
  6. Now lets make sure it works, by logging into to silver
    $ ssh silver
    If this does not ask you for a password, then you have done it right!
Note: If you're not doing this from a SUCS computer, you'll need to copy your key to your SUCS account. To do this, use the scp (secure copy) command.
$ scp .ssh/id_rsa.pub your_username@sucs.org:.ssh/id_rsa.pub.tmp
Then on a SUCS machine,
$ cd .ssh/
$ cat id_rsa.pub.tmp >> authorized_keys2
This will append your public key onto the authorized_keys2 file.
Page last modified by rollercow on Wed, 21 Nov 2018 17:37:18 +0000