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.
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!
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.
All the relevant information and a clickable IP address, linked as
ssh://22.214.171.124 for our convenience.
Saves another couple of seconds a day!