Add SSH key to Vyatta for SSH authentication

I was trying to set up unattend ssh login for vyatta user by concatenate my computer's public key to /home/vyatta/.ssh/authorized_keys but every time the server gets restarted, the key's gone. I shouldn't do it that way because Vyatta has its own way of managing ssh keys. Do this instead:

1. From my computer, copy the public key to vyatta server:

$ rsync -arv ~/.ssh/id_rsa.pub vyatta@vyatta:/home/vyatta

(at this point, I have to enter the password for vyatta user)

2. On Vyatta, using Vyatta's commands to import the key:

$ configure
$ loadkey vyatta /home/vyatta/id_rsa.pub

From now I don't have to enter password to ssh to Vyatta.

Comments