Last active
March 17, 2024 16:26
-
-
Save zenthangplus/55dfbe88c7c6a0633e07c01fd737be70 to your computer and use it in GitHub Desktop.
How to generate RS256 Key Pair for Mac & Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Generate rsa keys pair | |
ssh-keygen -t rsa -b 4096 -f rs256.rsa | |
# Don't add passphrase | |
openssl rsa -in rs256.rsa -pubout -outform PEM -out rs256.rsa.pub | |
# Done | |
cat rs256.rsa | |
cat rs256.rsa.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Ubunutu (22) the first command shall be rather:
otherwise you might encounter: Could not read private key from rs256.rsa.