Skip to content

Instantly share code, notes, and snippets.

@Scorcerer
Created February 29, 2024 22:44
Show Gist options
  • Select an option

  • Save Scorcerer/ce14ef343af7a4120bdf3682cf8de8a0 to your computer and use it in GitHub Desktop.

Select an option

Save Scorcerer/ce14ef343af7a4120bdf3682cf8de8a0 to your computer and use it in GitHub Desktop.
One-liner to deploy a SSH key for your user in MikroTik RouterOS
# All credits go to https://superuser.com/questions/1670773/how-can-i-add-my-ssh-public-key-to-a-mikrotik-router-device-using-the-command-li
ssh destination "/file print file=mykey; file set mykey contents=\"`cat ~/.ssh/id_rsa.pub`\";/user ssh-keys import public-key-file=mykey.txt;/ip ssh set always-allow-password-login=yes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment