Skip to content

Instantly share code, notes, and snippets.

@j3tm0t0
Last active April 18, 2016 09:06
Show Gist options
  • Save j3tm0t0/10006334 to your computer and use it in GitHub Desktop.
Save j3tm0t0/10006334 to your computer and use it in GitHub Desktop.
loadkey
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
configure
loadkey vyos http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
set service ssh disable-password-authentication
commit
vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces vti vti0
[edit]
vyos@vyos# exit discard
exit
vyos@vyos:~$ cat > /var/tmp/loadkey.sh
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
configure
loadkey vyos http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
set service ssh disable-password-authentication
commit
vyos@vyos:~$ sudo vbash /var/tmp/loadkey.sh
######################################################################## 100.0%
Done
[ service ssh ]
Restarting OpenBSD Secure Shell server: sshd.
vyos@vyos:~$ configure
[edit]
vyos@vyos# set interfaces vti vti0
Set failed
[edit]
vyos@vyos#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment