How to set iTerm2 as the default ssh:// handler on Mac OSX

Profile image of Mattias Geniar

Mattias Geniar, December 09, 2015

Follow me on Twitter as @mattiasgeniar

If you click a link on Mac OSX that starts with ssh://, you can have it spawn iTerm2 as the default SSH handler instead of the ‘classic’ Here’s how you change it.

Change the default ssh:// handler in iTerm2 itself

Go to Preferences > Profiles > General and mark the “ssh” URL scheme in the dropdown at the bottom.


You’ll be prompted to confirm changing the default handler and you should be good to go.

Change the default ssh:// handler with Default App

If the above didn’t work (because it didn’t for me) there’s an alternative. First, download and install the Default Apps preferences tool.

Since you’re using iTerm2 and looking to change the ssh:// handler, I’ll assume you know your way around your Mac and you can figure out how to install that tool yourself.

Once you’ve got it installed, go to your System Preferences, search for Default Apps at the bottom and open it.


In there, go to URLS and find the “ssh” option. In the dropdown to the right, chose your preferred tool.


Good to go!

The result

Every time you click on a ssh:// link, your Mac can now open iTerm2 to connect to that IP or hostname. This is especially useful if you’re having your server alerts or management tools link directly to ssh:// and you can just click it to login in.

For instance, here’s how our monitoring is reported in Hipchat at Nucleus.


All the relevant information and a clickable IP address, linked as ssh:// for our convenience.

Saves another couple of seconds a day!

Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.