more info
[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   `ssh-pubkey` will make sure you have an SSH key, and then print it to the screen and place it in `~/Downloads`
9 ---
10
11 > Your SSH Public Key is used for secure login from your laptop to servers and
12 > other network devices - such as Raspberry Pis, game consoles, and home cloud
13 > systems. The file public key _always_ ends in `.pub`.
14
15 The easiest way to get your SSH Public Key:
16
17 ```bash
18 curl https://webinstall.dev/ssh-pubkey | bash
19 ```
20
21 ```txt
22 ~/Downloads/id_rsa.johndoe.pub:
23
24 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOhRnzDJNBNBXVCgkxkEaDM4IAp81MtE8fuqeQuFvq5gYLWoZND39N++bUvjMRCveWzZlQNxcLjXHlZA3mGj1b9aMImrvyoq8FJepe+RLEuptJe3md4EtTXo8VJuMXV0lJCcd9ct+eqJ0jH0ww4FDJXWMaFbiVwJBO0IaYevlwcf0QwH12FCARZUSwXfsIeCZNGxOPamIUCXumpQiAjTLGHFIDyWwLDCNPi8GyB3VmqsTNEvO/H8yY4VI7l9hpztE5W6LmGUfTMZrnsELryP5oRlo8W5oVFFS85Lb8bVfn43deGdlLGkwmcJuXzZfostSTHI5Mj7MWezPZyoSqFLl johndoe@MacBook-Air
25 ```
26
27 The standard location for your SSH Public Key:
28
29 ```bash
30 ~/.ssh/id_rsa.pub
31 ```
32
33 How to create an SSH Keypair if it doesn't already exist:
34
35 ```bash
36 if [ -f "$HOME/.ssh/id_rsa" ];then
37     ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
38 fi
39 ```
40
41 How to copy your SSH Public Key to from its hidden folder to your `Downloads`
42 folder:
43
44 ```bash
45 rsync -av "$HOME/.ssh/id_rsa.pub" \
46     "$HOME/Downloads/id_rsa.$(whoami).pub"
47 ```
48
49 How to print your public key to the Terminal:
50
51 ```bash
52 cat "$HOME/Downloads/id_rsa.pub"
53 ```