security:security_main
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| security:security_main [2022/11/19 19:51] – srohr | security:security_main [2022/11/19 20:11] (current) – srohr | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Security ====== | ||
| + | |||
| + | |||
| + | ===== Configure SSH Key-Based Authentication ===== | ||
| + | |||
| + | ==== Generate a public/ | ||
| + | |||
| + | //'' | ||
| + | |||
| + | < | ||
| + | username@client: | ||
| + | Generating public/ | ||
| + | Enter file in which to save the key (/ | ||
| + | Created directory '/ | ||
| + | Enter passphrase (empty for no passphrase): | ||
| + | Enter same passphrase again: | ||
| + | Your identification has been saved in / | ||
| + | Your public key has been saved in / | ||
| + | The key fingerprint is: | ||
| + | SHA256: | ||
| + | The key's randomart image is: | ||
| + | +---[RSA 4096]----+ | ||
| + | |XE.oo+ . . | | ||
| + | |X+= + o . . . ..| | ||
| + | |o= o o .. o . o| | ||
| + | |..o . + .+. = . .| | ||
| + | |.. + . oSo o * . | | ||
| + | | o + + + | | ||
| + | | . . = . | | ||
| + | | ... . | | ||
| + | | .... | | ||
| + | +----[SHA256]-----+ | ||
| + | username@client: | ||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | ==== Copy the public key from the client to the remote_host==== | ||
| + | |||
| + | //'' | ||
| + | < | ||
| + | username@client: | ||
| + | / | ||
| + | The authenticity of host ' | ||
| + | ECDSA key fingerprint is SHA256: | ||
| + | Are you sure you want to continue connecting (yes/ | ||
| + | / | ||
| + | / | ||
| + | username@remote_host' | ||
| + | |||
| + | Number of key(s) added: 1 | ||
| + | |||
| + | Now try logging into the machine, with: " | ||
| + | and check to make sure that only the key(s) you wanted were added. | ||
| + | |||
| + | username@client: | ||
| + | Linux remote_host 5.15.74-v7l+ #1595 SMP Wed Oct 26 11:05:08 BST 2022 armv7l | ||
| + | |||
| + | The programs included with the Debian GNU/Linux system are free software; | ||
| + | the exact distribution terms for each program are described in the | ||
| + | individual files in / | ||
| + | |||
| + | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
| + | permitted by applicable law. | ||
| + | Last login: Wed Jul 6 08:14:38 2022 from 172.16.1.36 | ||
| + | username@remote_host: | ||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | If ssh-copy-id isn't available, copy the public key with //'' | ||
| + | //'' | ||
| + | |||
| + | ==== Configure key-based authentication only ==== | ||
| + | |||
| + | If you want the SSH Server to only allow key-based authentication, | ||
| + | |||
| + | //'' | ||
| + | < | ||
| + | ... | ||
| + | PasswordAuthentication no | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ==== Restart the SSH Daemon ==== | ||
| + | |||
| + | Only required if the //''/ | ||
| + | //'' | ||
| + | |||
| + | ---- | ||
| + | ===== Allow root login ===== | ||
| + | |||
| + | //'' | ||
| + | < | ||
| + | ... | ||
| + | PermitRootLogin yes | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ==== Restart the SSH Daemon ==== | ||
| + | //'' | ||
| + | |||
