Acronym Soup - Setting up a Secure Shell Key in Kubuntu to access a Site5 Hosted Subversion Repository

Konsole ScreenshotI can't tell you how many times having a Subversion (SVN) repository has saved my butt with clients in the past. Most recently, one of my clients had inadvertently deleted their entire site and did not have any backups to restore it. Dun-Dun-Dah! SVN to the rescue!

However, when restoring the files, it became increasingly frustrating how many times I was asked for my password when browsing the file directories in KDESVN (Hey! Back off! I like using a GUI tool to browse my SVN repos and will eventually learn the command line syntax). So, after I "fixed" somebody else's mistake, I turned my attention to setting up a RSA private key/public key cryptographic pair to be able to access my SVN repository securely, and without being repeatedly asked for my password. Here are the steps I followed:

  1. Opened Konsole
  2. Navigated to the .ssh directory (If you don't have a directory named .ssh in your user's root folder, you will need to create it
    • cd ~/.ssh
  3. Created a RSA Public Key/Private Key pair
    • ssh-keygen -t rsa
    • Since I have several different servers I access, I named my key so I could easily distinguish between several keys (e.g. rsa_killboy or rsa_myBoringName)
    • Added a passphrase
  4. Upload the Public Key (the one with the .pub file extension) to your server's .ssh folder with Secure Copy (SCP)
    • scp rsa_MyKey.pub username@example.com:.ssh/
  5. SSH'd into my site and navigated into the .ssh folder
  6. Added my Public Key to the authorized_keys file by using the Concatenate command (cat), securly deleted the Public Key file, and changed the file's permission for added security
    • cat rsa_MyKey.pub >> authorized_keys
    • shred -u rsa_MyKey.pub
    • chmod 600 authorized_keys
    • exit (to break the connection to the server)
  7. Now that my Public Key is on the server, I need to add my Private Key (this is the one without the file extension) to the SSH Agent on my local machine
    • cd ~/.ssh/
    • ssh-add rsa_MyKey
    • enter passphrase
  8. Test the Connection to the server
  9. Tested the Connection in KDESVN
    • Open KDESVN
    • Open Repository
    • On Site5, the syntax is as follows: svn+ssh://username@example.com/home/username/svn/