Monday, October 2, 2017

SSH Error When Trying to Connect to a Switch from MacOS Sierra

I love that MacOS has SSH built right into the terminal.  That really makes it easy to manage switches, routers, and firewalls with no extra software.

I did run into one issue after upgrading to Sierra.  When trying to SSH into some older devices, you may see this:

mac:~ user$ ssh user@old-switch.example.org
Unable to negotiate with old-switch.example.org port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

Of course you'll want to upgrade the operating system on your device as soon as possible, but in the meantime you can do the following to fix the issue:


  • Create a file in your home directory named .profile
  • Put the following line in .profile
alias ssh1='ssh -o Kexalgorithms=+diffie-hellman-group1-sha1'
  • Close your terminal window, then open it back up and should be able to use your new ssh1 command to SSH into your device like this:
ssh1 user@old-switch.example.org



That's it!

Here's the one-liner if you're a lazy typer an efficient typer like me:

echo alias ssh1='ssh -o Kexalgorithms=+diffie-hellman-group1-sha1'> ~/.profile


Mac Spotlight Can't Find Your Applications

Have you ever installed an App or Program on you Mac and then noticed that Spotlight can't find it?

Here's how you can fix this problem:


  • Open Finder and click on Applications (we'll come back to this later).
  • Open System Preferences, click Spotlight, and then click the Privacy tab.
  • Drag the Applications icon from the top of your Finder window into the Privacy tab of the Spotlight System Preferences. 
Note: Sometimes it's a little tricky to drag the icons from the top of a finder window.  Trying holding still over the icon after you click it for just a second before you start dragging it.

  • Now select Applications in the Privacy tab of the Spotlight System Preferences and click the minus sign.

Try spotlight again and it should find your new App!

More information: How to rebuild the Spotlight index on your Mac