4 Feb 23, 2013

Sync SSH config across computers with Dropbox

Here’s a little time-saving tip for Mac OS X/Linux users: if you work with lots of different Macs and servers daily, store your SSH configuration file in dropbox, and create a symbolic link to it so you can sync it across your computers.

With this, once I add a new machine to my SSH config, it’s immediately available across all of my computers, my workstation, laptop, work machine, etc. I’m terrible at remembering hostnames and IP-addresses, so this comes in handy as I acquire control over more and more servers.

Also, you can of course extend this method to sync other types of configuration files, like your git config or bash profile. Dropbox is a neat tool!

Step 1

Create a folder in your Dropbox to store files like these.

mkdir ~/Dropbox/configs

Step 2

Move your ssh config to this folder. I just call it ssh-config.txt instead of simply config for easier access and as to not mix it up with other configuration files.

mv ~/.ssh/config ~/Dropbox/configs/ssh-config.txt

Step 3

Create a symbolic link to the new configuration file.

ln -s ~/Dropbox/configs/ssh-config.txt ~/.ssh/config

4 Responses to “Sync SSH config across computers with Dropbox”

  1. Joao Says:

    This is not working for me. It seems that the reason is that the symlink ~/.ssh/config has 777 permissions ans ssh will not trust such a config file.

    How did you get past that?


  2. Joao Says:

    Sorry, that was not the issue. Made it work :)

  3. Matthew Alexander Says:

    > Sorry, that was not the issue. Made it work :)

    What was the issue?

  4. Kuchi Says:

    Even better use a git repository to track all the changes you made in the configs.
    It also can live in Dropbox als long only one user makes changes to it :)

Leave a Reply