SSH is a connection tool.
You need a public and private key generated by a command.
+This key is used for facilitating connections.
SSH has several important files:
- .ssh/config <- On this later
-- .ssh/key (private) .ssh/key.pub
+- .ssh/key (a private key, don't send this to anyone for any reason), and .ssh/key.pub (a PUBlic key, distribute as you wish)
- .ssh/known_hosts <- Records of prior connections, may be invalidated or deleted
. .ssh/authorized_keys <- list of public keys (literally cat of the .pub) allowed to SSH into this user, never provided by default
Your identification has been saved in /home/emil/.ssh/id_ed25519
Your public key has been saved in /home/emil/.ssh/id_ed25519.pub
The key fingerprint is:
-SHA256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA emil@box
+SHA256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA emil@box # obvious this will be your user@host
The key's randomart image is:
+--[ED25519 256]--+
|AAAAAAAAAAAAAAAAA|
### Making a connection ###
+```sh
ssh user@box -i ~/.ssh/key # as in the private key, not the public
-> Blah Blah Blah new connection will be added to .ssh/known_hosts
-> say YES.
+-- Blah Blah Blah new connection will be added to .ssh/known_hosts
+-- say YES.
+```
+
+If you encounter a screaming message about a potential Man In The Middle, it is usually caused by some dramatic change to the remote system.
+If you changed the remote sshd configuration or suspect that is the case, then it would be generally safe to ignore the alert.
-You can see the actual ssh(1) for exact usage and what else you can do.
+You can see the actual ssh(1) for exact usage and what else you can
+do.
### Config ###
```yaml
Host git.xolatile.top
- IdentityFile ~/.ssh/model
+ IdentityFile ~/.ssh/xolatile
User git
```
By default ssh uses your user (which is also the default connection user) to find the default public key.
-hence, when you ```ssh somehost``` ssh will first look at your current user, and then look for and use ```~user/.ssh/user``` unless specified via an option or by config.
+hence, when you ```ssh somehost``` ssh will first look at your current user, and then look for and use the public key in ```~user/.ssh/user``` unless specified via the ```-i``` option or by your config file.
You can also do wildcards, this is covered further in the ssh_config(5) manual page.