Last active
September 20, 2024 16:01
-
-
Save hongkongkiwi/fff178c3243ae5aaff8e 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.
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
HOSTNAME=`hostname` ssh-keygen -t rsa -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
Why not auto copy in clipboard ?
You need to install xclip either in linux or mac:
linux:
sudo apt-get install xclip
mac:
brew install xclip
and then append to any of the above commands:
| xclip -selection clipboard