Let’s say you want to create an automated nightly backup of your MySQL database to Strongspace but you don’t want to leave your Strongspace password stored directly in your backup script for all to see. Strongspace lets you create trusted relationship between your machine and Strongspace using SSH keys. You can think of an SSH key as two extremely long passwords, stored in a files, that SFTP and rsync will use to authenticate with Strongspace. You hold on to the private key and give Strongspace the public key. There is now a unique secure relationship between your machine and Strongspace that lets you safely authenticate without your primary account password.
###Generating SSH Keys
Mac or Linux:
1. Open up your Terminal application
2. Type: `ssh-keygen` to generate the keys
3. You will then be prompted to enter a location to save the key pair. Feel free to use the default.
4. After generating the keys it will prompt for a passphrase. This will be used when accessing the keys, providing another level of security if someone were to obtain your private key (which of course you shouldn’t share). You can leave it blank for rsync backups to Strongspace to work seamlessly without requiring the user to type in a password. However except for this case you should add a passphrase.
5. Copy the contents of id_rsa.pub to the clipboard. On a Mac, with the Terminal still open, type: `cat ~/.ssh/id_rsa.pub | pbcopy`
1. Download and run [PuTTYgen](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
2. Click Generate public/private key pair
3. Save public key – save pick a name like `id_rsa.pub`
4. Save your private key. When saving your private key, PuTTYgen gives you two options, the default is to save in the PuTTY format [`.ppk`] or you click on the conversions menu and export an OpenSSH format key. Depending on what application you use these keys with you might want to export both.
5. Select and copy the public key to your clipboard
###Using SSH Keys on Strongspace
Sign into Strongspace, head over to the Account tab, and select the [SSH Public Keys sub-tab](https://www.strongspace.com/account/ssh_keys). Click [Add a new key…](https://www.strongspace.com/account/ssh_keys/new) and paste in the contents of your public key, along with an optional nickname and click `Save key`.
To test our your key setup log into Strongspace using the command line `sftp` tool on Mac or Linux:
Where `username` is your Strongspace username. You should now be logged into Strongspace without having used a password. Good job!