rename for download
[webi-installers/.git] / ssh-pubkey / README.md
1 ---
2 title: SSH Pub Key
3 homepage: https://webinstall.dev/ssh-pubkey
4 tagline: |
5   Get your SSH public key.
6 linux: true
7 description: |
8   > Your SSH Public Key is used for secure login from your laptop to servers and
9   > other network devices - such as Raspberry Pis, game consoles, and home cloud
10   > systems. The file public key _always_ ends in `.pub`.
11
12   `ssh-pubkey` will:
13
14     1. Create a new ssh keypair if you don’t already have one
15     2. Copy your new or existing SSH Public Key to your `Downloads` folder
16     3. Print the location of the copied key, and its contents to the screen
17 ---
18
19 The easiest way to get your SSH Public Key:
20
21 ```bash
22 curl https://webinstall.dev/ssh-pubkey | bash
23 ```
24
25 ```txt
26 ~/Downloads/id_rsa.johndoe.pub:
27
28 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOhRnzDJNBNBXVCgkxkEaDM4IAp81MtE8fuqeQuFvq5gYLWoZND39N++bUvjMRCveWzZlQNxcLjXHlZA3mGj1b9aMImrvyoq8FJepe+RLEuptJe3md4EtTXo8VJuMXV0lJCcd9ct+eqJ0jH0ww4FDJXWMaFbiVwJBO0IaYevlwcf0QwH12FCARZUSwXfsIeCZNGxOPamIUCXumpQiAjTLGHFIDyWwLDCNPi8GyB3VmqsTNEvO/H8yY4VI7l9hpztE5W6LmGUfTMZrnsELryP5oRlo8W5oVFFS85Lb8bVfn43deGdlLGkwmcJuXzZfostSTHI5Mj7MWezPZyoSqFLl johndoe@MacBook-Air
29 ```
30
31 The standard location for your SSH Public Key:
32
33 ```bash
34 ~/.ssh/id_rsa.pub
35 ```
36
37 How to create an SSH Keypair if it doesn't already exist:
38
39 ```bash
40 if [ -f "$HOME/.ssh/id_rsa" ];then
41     ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
42 fi
43 ```
44
45 How to copy your SSH Public Key to from its hidden folder to your `Downloads`
46 folder:
47
48 ```bash
49 rsync -av "$HOME/.ssh/id_rsa.pub" \
50     "$HOME/Downloads/id_rsa.$(whoami).pub"
51 ```
52
53 How to print your public key to the Terminal:
54
55 ```bash
56 cat "$HOME/Downloads/id_rsa.pub"
57 ```