Skip to content

Instantly share code, notes, and snippets.

@gabrik
Forked from hongkongkiwi/generate-ssh-key
Last active May 5, 2023 06:53
Show Gist options
  • Save gabrik/b2044c5e02e7644651b1c0417cb2c9f4 to your computer and use it in GitHub Desktop.
Save gabrik/b2044c5e02e7644651b1c0417cb2c9f4 to your computer and use it in GitHub Desktop.
Simple one liner to generate an SSH key without a password in the default place with the comment as hostname then print out the public key for copy and paste.
HOSTNAME=`hostname` ssh-keygen -t ecdsa -C "$HOSTNAME" -f "$HOME/.ssh/id_rsa" -P "" && cat ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment