If you want to login to your EdgeOS router using your SSH identity instead of a password, you can. Make sure you already have your SSH identity (key, pubkey). You'll need your pubkey later on to whitelist it in your EdgeOS config.
To configure SSH login using your your ssh key instead of a password, SSH into your EdgeRouter:
ssh {your-webinterface-username}@{your-router-ip} -p 22
Eg. ssh johndoe@192.168.1.1 -p 22
When logged in, start configuration mode:
configure
This tutorial assumes your username (to access the EdgeOS web interface (and SSH, just now)) is johndoe
, replace johndoe
with your actual username.
Now configure your SSH login key type:
set system login user johndoe authentication public-keys johndoe@device type ssh-rsa
Eg. set system login user myAdminAccount authentication public-keys myAdminAccount@myMacbook type ssh-rsa
Now add your public key. The value to add after key
in the command below should be the Base64 string that's usually in your id_rsa.pub
, without the ssh-rsa
prefix, and without the hostname@device appended.
On OSX you can get this value using:
cat ~/.ssh/id_rsa.pub|cut -d " " -f 2
set system login user johndoe authentication public-keys johndoe@device key AAAAB.........
Now commit your settings:
commit
Open a second terminal window to check if you can sign in using your SSH identity, without a password. If everything works, you can save & exit:
save; exit
Top comments (0)