Add an SSH Key to Ubiquiti EdgeRouter
Not a valid key file format (see man sshd) at /opt/vyatta/sbin/vyatta-load-user-key.pl line 96, <$in> line 1.
Turned out that the key needs to:
- have a comment
- not have any spaces in the comment
- be on a line of it’s own in the imported file (e.g. do not add a newline at the end)
loadkey to accept it.
While my normally used pubkey has spaces in the comment, this was an easy fix once I knew what Vyatta’s problem is. I edited the import file to look as follows
ssh-rsa AAAAB3Nza…U6WQPNk= private_key
Once these conditions are met, save the key in a file on the EdgeRouter
/tmp/my_pubkey) and then import that file as follows;
configure loadkey <user> /tmp/my_pubkey commit save exit