Posted 01.03.2013
Setting Up a Site with SSH
Recently, I was trying to set up a project for a client using SpringLoops. I had worked with git before through gitHub, but never SpringLoops and never with SSH.
Several hours later, I got everything up and running. So, in an effort to save you from the same heartache, I’d thought I’d share.
Login to your SpringLoops account.
Click on your project folder
Click on the Source and Deploy tab
Click on the My Repository Access Details button
If a repository has already been set up for a particular project, you can click on the Source and Deploy tab and look for the green Access Details button
A modal window will appear displaying your repository access details. Click on the Manage link under SSH keys.
Then, click on the Add a new SSH key tab.
Now, switch over to the Terminal.
First, you’ll need to check for existing SSH keys.
In Terminal run:
This checks to see if there is an existing directory named .ssh in your user directory.
If there is, you’ll want to backup your existing keys.
This lists all the subdirectories in the current directory. You should see something similar to the following:
Let’s create a folder to hold our backups
Then, we want to copy all our existing keys into this folder
Then, get rid of the duplicate files.
Now, we need to generate a new SSH key. If you’re on a Mac, this is already built in (I think). At least, I didn’t have to do anything special.
This generates a new SSH key using the email address you provide.
The prompt should then say something like:
Simply, press enter.
Now, you’ll want to enter a passphrase. On Mac OSX Leopard and later, there’s an ssh-agent
built in so your keys can be saved in the system’s keychain to make life (a little) easier.
# Enter same passphrase again: [Type passphrase again]
Then, you should see something similar to the following:
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Excellent! Now, you just need to add the key to SpringLoops. Unfortunately, it isn’t as easy as copy and paste…well, kind of. You have to make sure you copy the code exactly. No extra whitespace.
In terminal, type
This copies everything you need to your clipboard. Now, go back to your SpringLoops window. You should still have the Add a new SSH key window open.
Paste your key into the textarea. Then, click on the blue button, Create this New Key. You’ll now see your key listed under the Manage your SSH keys tab.
Whew. We’re almost done.
I know just enough about git to be dangerous. Half the time I use the Terminal, the other half of the time, I use a GUI. I’m always afraid I’ll be one character off and do something permanently damaging in the Terminal. Besides, as a designer, a user interface is always better (well, as long as it’s well designed). In this particular instance, I’ll be using Tower.
Click on the Repositories button in the top left.
Click on the Manage Repositories button.
Click on the Clone Remote Repository button.
Now, go back to SpringLoops and get your SSH address.
Paste it in the Repository URL in Tower.
Change Authentication to Private Key.
Under Key Password enter your passphrase that you used when creating your SSH Key.
Under, Clone To: find the directory you want to save your repository in.
Click on the Clone button.
Magic.
See?! That wasn’t that hard…if you know what you’re doing. gitHub has some excellent resources and documentation on their site. — and if you’re using gitHub instead of SpringLoops, the steps are pretty similar. Feel free to check out gitHub’s SSH guide.