Last active
March 12, 2019 18:41
-
-
Save mfurquimdev/5a329138741a3bea5e1ad7a56a52cedc to your computer and use it in GitHub Desktop.
Generate ssh key with nice comment, no password and default place.
This file contains hidden or 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
| # Linux | |
| ssh-keygen -t rsa -b 4096 -C "$USER@$(uname -n).$(cut -f 1 -d ' ' /etc/issue | head -n 1 | sed -e 's/\(.*\)/\L\1/')" -N '' -f /home/$USER/.ssh/id_rsa | |
| # Mac OS | |
| ssh-keygen -t rsa -b 4096 -C "$USER@$(uname -n).$(sw_vers | head -1 | cut -c 14-19)" -N '' -f /Users/$USER/.ssh/id_rsa |
This file contains hidden or 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
| last=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment