ssh_keys
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ssh_keys [2016/05/03 07:07] – luke7858 | ssh_keys [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| 01: | 01: | ||
| </ | </ | ||
| - | === Copying keys === | + | \\ |
| + | === Copying | ||
| Now we need to copy the public key onto the server | Now we need to copy the public key onto the server | ||
| <sxh bash> | <sxh bash> | ||
| ssh-copy-id -i ~/ | ssh-copy-id -i ~/ | ||
| </ | </ | ||
| + | If the server has a custom port: | ||
| + | <sxh bash> | ||
| + | ssh-copy-id -i ~/ | ||
| + | </ | ||
| + | \\ | ||
| === Logging in using private key === | === Logging in using private key === | ||
| You can then log into the device using the private key: | You can then log into the device using the private key: | ||
| Line 46: | Line 52: | ||
| ssh ServerName | ssh ServerName | ||
| </ | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | === Locking Down to Keys-Only === | ||
| + | Next we could potentially lock down the server so ONLY keys work. | ||
| + | \\ | ||
| + | Add the following to / | ||
| + | <sxh bash> | ||
| + | PasswordAuthentication no | ||
| + | </ | ||
| + | Then make sure you reload the configuration file. | ||
| + | \\ | ||
| + | \\ | ||
| + | WARNING: Keep one session open and attempt to log in from a different session, this allows you to get back in if you made an incorrect update | ||
ssh_keys.1462259259.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
