How to add SSH keys to Edgerouter

James Tenniswood
Jan 5, 2017 · 1 min read

I use the wonderful Ubiquiti Edgerouter network router at home, its a fantastic machine, very powerful and uses linux, so can be customised and used from more tricks than was originally intended, I’m going to write up my favourites, to get started let’s first secure your ssh connection using an SSH key.

If you already have a key created, you can skip this bit. Customise with your email address, and call the file id_rsa. Make sure to backup the keys, you will use the public part to share with remote machines, they will match it to your private one stored on your machine.

cd ~/.ssh
ssh-keygen -t rsa -C "your_email@example.com"

The first step is to copy your ssh public key to the ERL. Change to add your routers IP address below.

scp ~/.ssh/id_rsa.pub <ip-of-erl>:/tmp

After this you need to associate the public key with your user on the ERL. Sign into the router using over SSH using terminal, putty or iTerm.

configure 
loadkey <user> /tmp/id_rsa.pub
commit
save
exit

Now you should be able to log out and then log back in using your ssh key and not have to use your password to do so.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store