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

Mattias Geniar, Wednesday, December 9, 2015

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' Terminal.app. 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.

iterm2_ssh_handler

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.

default_apps_preferences

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

default_apps_ssh_handler

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://10.0.5.1 and you can just click it to login in.

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

hipchat_notification_alert

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

Saves another couple of seconds a day!



Hi! My name is Mattias Geniar. I'm a Support Manager at Nucleus Hosting in Belgium, a general web geek & public speaker. Currently working on DNS Spy & Oh Dear!. Follow me on Twitter as @mattiasgeniar.

Share this post

Did you like this post? Will you help me share it on social media? Thanks!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Inbound links