chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / ssh-pubkey / README.md
index fe0cb789bc5e2f0129460e94290edbe7182c5dbe..a95ce5403202f1fb1142637663acf354e55a4983 100644 (file)
@@ -3,15 +3,24 @@ title: SSH Pub Key
 homepage: https://webinstall.dev/ssh-pubkey
 tagline: |
   Get your SSH public key.
-linux: true
-description: |
-  `ssh-pubkey` will make sure you have an SSH key, and then print it to the screen and place it in `~/Downloads`
 ---
 
-Get your public key, the easy way:
+## Cheat Sheet
+
+> Your SSH Public Key is used for secure login from your laptop to servers and
+> other network devices - such as Raspberry Pis, game consoles, and home cloud
+> systems. The file public key _always_ ends in `.pub`.
+
+`ssh-pubkey` will:
+
+1. Create a new ssh keypair if you don’t already have one
+2. Copy your new or existing SSH Public Key to your `Downloads` folder
+3. Print the location of the copied key, and its contents to the screen
+
+The easiest way to get your SSH Public Key:
 
 ```bash
-ssh-pubkey
+curl https://webinstall.dev/ssh-pubkey | bash
 ```
 
 ```txt
@@ -20,19 +29,29 @@ ssh-pubkey
 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOhRnzDJNBNBXVCgkxkEaDM4IAp81MtE8fuqeQuFvq5gYLWoZND39N++bUvjMRCveWzZlQNxcLjXHlZA3mGj1b9aMImrvyoq8FJepe+RLEuptJe3md4EtTXo8VJuMXV0lJCcd9ct+eqJ0jH0ww4FDJXWMaFbiVwJBO0IaYevlwcf0QwH12FCARZUSwXfsIeCZNGxOPamIUCXumpQiAjTLGHFIDyWwLDCNPi8GyB3VmqsTNEvO/H8yY4VI7l9hpztE5W6LmGUfTMZrnsELryP5oRlo8W5oVFFS85Lb8bVfn43deGdlLGkwmcJuXzZfostSTHI5Mj7MWezPZyoSqFLl johndoe@MacBook-Air
 ```
 
-Create an SSH keypair if you don't have one:
+The standard location for your SSH Public Key:
+
+```bash
+~/.ssh/id_rsa.pub
+```
+
+How to create an SSH Keypair if it doesn't already exist:
 
 ```bash
-[ -f "$HOME/.ssh/id_rsa" ] || ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
+if [ -f "$HOME/.ssh/id_rsa" ];then
+    ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
+fi
 ```
 
-Copy your public key to `~/Downloads`:
+How to copy your SSH Public Key to from its hidden folder to your `Downloads`
+folder:
 
 ```bash
-rsync -av "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
+rsync -av "$HOME/.ssh/id_rsa.pub" \
+    "$HOME/Downloads/id_rsa.$(whoami).pub"
 ```
 
-Print your public key to the Terminal:
+How to print your public key to the Terminal:
 
 ```bash
 cat "$HOME/Downloads/id_rsa.pub"