Troy Thompson

Web Developer

  1. SSH Keypairs for Easy Login

    Published
    Tagged
    Content

    Tired of entering your password everytime you want to connect to a server? Me too, read this.

    Creating your public Key

    1. On your local machine.
    2. Open Terminal.
    3. ssh-keygen
    4. Hit enter when asked for filename or password

    Creating Server Aliases

    1. Edit ~/.ssh/config file
    2. Add the following:
      Host ALIAS
      HostName HOST.COM
      User USER
    3. Save

    Adding Key to Authorized Keys on Server

    1. scp ~/.ssh/id_rsa.pub ALIAS:
    2. ssh ALIAS
    3. Enter password when prompted.
    4. mkdir .ssh
    5. chmod 700 .ssh
    6. cd .ssh
    7. touch authorized_keys
    8. chmod 600 authorized_keys
    9. cat ~/id_rsa.pub >> authorized_keys

    Now you should be able to do ... ssh ALIAS and instantly login to your server.

    Respond
    ( will not be published or shared )