Skip to content

Instantly share code, notes, and snippets.

@dswwsd
Forked from hongkongkiwi/generate-dropbear-key
Last active August 9, 2022 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dswwsd/b10878d2361722a8e5c36cb519724664 to your computer and use it in GitHub Desktop.
Save dswwsd/b10878d2361722a8e5c36cb519724664 to your computer and use it in GitHub Desktop.
Generate SSH Key in Dropbear
#!/bin/bash
KEY_DIR="~/.ssh"
# Make directories
mkdir -p "$KEY_DIR"
# Generate an RSA key using dropbear
dropbearkey -t rsa -f "${KEY_DIR}/id_rsa"
# Output Public Key
dropbearkey -y -f "${KEY_DIR}/id_rsa" | grep "^ssh-rsa " > "${KEY_DIR}/id_rsa.pub"
# Show Public Key
cat "${KEY_DIR}/id_rsa.pub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment