Skip to content

Instantly share code, notes, and snippets.

@artynet
Forked from Juul/ssh-copy-id-openwrt
Created March 16, 2019 18:18
Show Gist options
  • Select an option

  • Save artynet/5052101ac2609164c11e4d2fe685abb1 to your computer and use it in GitHub Desktop.

Select an option

Save artynet/5052101ac2609164c11e4d2fe685abb1 to your computer and use it in GitHub Desktop.
ssh-copy-id but for openwrt / dropbear
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Example: ${0} root@192.168.1.1"
exit 1
fi
cat ~/.ssh/id_rsa.pub | ssh ${1} "cat >> /etc/dropbear/authorized_keys && chmod 0600 /etc/dropbear/authorized_keys && chmod 0700 /etc/dropbear"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment