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


1 comment:

  1. Therapy can help couples decide whether to remain married or divorce. Therapist for Anxiety

    ReplyDelete