-
Notifications
You must be signed in to change notification settings - Fork 1
/
Keys.txt
31 lines (22 loc) · 1.39 KB
/
Keys.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2016-11-22T23:38:53+01:00
====== Keys ======
Created tirsdag 22 november 2016
**SSH Keys are used instead of passwords - a fast authentication. **
== A quick info ==
**SSH keys are generated in pairs - one public and one private. Share the public key all you want, but safeguard the private key. **
**The public key is then used to encrypt a message - the public key is NOT able to decrypt this very same message - so the trick is, that the public key gives you an **encrypted** message which only the private key-holder will be able to give the appropriate responds to. **
== Storage ==
**#** **The keys is by default stored in **//~/.ssh///
**#** **The public key will be the one with the **//.pub //**suffix**
== Generate a pair of SSH keys ==
**# We append **//-C//** to add a comment. In this case the user, host and date is used for easy verification**
$ ssh-keygen -C "$(whoami)@$(hostname)-$(date -I)"
**# You will be prompted where to store the private key - leave this option to default (**//~/.ssh///**)**
**# Choose a strong Password**
== Change Password on a private key - without changing the key itself ==
$ ssh-keygen -f ~/.ssh///key-id// -p
== Copy public key to remote server ==
**# If the SSH server does not run on port 22, append the **//-p <PORT_NUMBER>//
$ ssh-copy-id -i ~/.ssh///key_id//.pub [email protected]