What is the correct way to add a public ssh key?


In other Linux platforms, I would add my SSH RSA public key to the ~/.ssh/authorized_keys file. But when I go in to the VyOS .ssh/authorized_keys file, it says:

[code]vyos@VYOS# cat .ssh/authorized_keys

Automatically generated by Vyatta configuration

Do not edit, all changes will be lost[/code]

What is the correct way to add a key in VyOS that will survive a reboot?


from op mode


Thanks syncer. This is what I get when I try that:

[code]vyos@VYOS:~$ loadkey vyos mykey.pub

Invalid command: [loadkey][/code]

If I try tab completion via sudo, the closest that I see is “loadkeys”:

[code]vyos@VYOS:~$ sudo load
loadfont loadfont.bb loadkeys loadkmap loadkmap.bb loadunimap

vyos@VYOS:~$ sudo loadkeys -h
loadkeys version 1.15.2

Usage: loadkeys [option…] [mapfile…]

Valid options are:

-b --bkeymap output a binary keymap to stdout
-c --clearcompose clear kernel compose table
-C <cons1,cons2,…> --console=<cons1,cons2,…>
the console device(s) to be used
-d --default load “defkeymap.kmap”
-h --help display this help text
-m --mktable output a “defkeymap.c” to stdout
-q --quiet suppress all normal output
-s --clearstrings clear kernel string table
-u --unicode force conversion to Unicode
-v --verbose report the changes


Here is my VyOS version:

vyos@VYOS:~$ show version Version: VyOS 1.1.5 Description: VyOS 1.1.5 (helium)


You will need to upgrade to 1.1.7
be sure that you run command from op mode and not from configuration mode
in configuration mode you will need to prepend run
run loadkey vyos /path/to/id_rsa.pub


Thanks syncer. Is there a way to do it in my current version, even if it is not persistent across a reboot?


It’s same i think down to first versions
still i will recommend update (that should take not much time)