Howto Add SSH Key to Authorized Keys List and Enable Remote Access on Linux and Unix

December 30th, 2011 by Regaz

How-to Authorize SSH Access for Remote Client

This little Guide Shows You Step-by-Step How-to Authorize the SSH Remote Access to Server for a Remote Linux/Unix Client.

Practically You will Need to Add an Entry to the Authorized Keys List on the id_dsa.pub File on Your Home .ssh Directory

Howto Add SSH Key to list of Authorized Keys - Featured
  1. How-to Easy Generate SSH Keys Pair:

    Generate SSH Keys Pair
  2. To Upload the Key to the Server you need the SSH Access Password

    For Shared Hosting Account often that’s the Same as the cpanel one.

  3. Upload It by the rsync Command:

    rsync -av -e "ssh -p PORT-NUMBER" ~/.ssh/id_dsa.pub USERNAME@SERVER-ADDRESS:~/

    You need to Substitute PORT-NUMBER, USERNAME and SERVER-ADDRESS with your Hosting Parameters.

  4. SSH Log-In into the Remote:

    ssh -p PORT-NUMBER USERNAME@SERVER-ADDRESS

    Normaly now you will be Prompt for the Password to get Access.

  5. Copy the Key into the Authorized List:

    cat id_dsa.pub >> .ssh/authorized_keys
  6. Latest Check than you haven't any blank line inserted into the ssh Keys Stack with:

    cat .ssh/authorized_keys
  7. After is Time to Try your Newly Authorized SSH Access with:

    Eventually Close the SSH Session with:

    logout

    LogIn:

    ssh -p PORT-NUMBER USERNAME@SERVER-ADDRESS

    And like a Charm you should Get Direct Access into the Server.

Tags: , , ,