Skip to content

Instantly share code, notes, and snippets.

@Juul
Last active August 23, 2023 11:10
Show Gist options
  • Save Juul/3265ded190c09093c36e to your computer and use it in GitHub Desktop.
Save Juul/3265ded190c09093c36e 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"
@Sbgodin
Copy link

Sbgodin commented Jan 11, 2021

chmod -R go=- /etc/dropbear

Will remove all rights for Group and Others.

@lavinkabul
Copy link

How to run this script and which way to put it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment