Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| rh124_ssh [2026/10/23 12:12] – [Overview] rpjday | rh124_ssh [2026/10/30 08:42] (current) – [The SSH host keys] rpjday | ||
|---|---|---|---|
| Line 46: | Line 46: | ||
| $ sudo systemctl stop sshd.service | $ sudo systemctl stop sshd.service | ||
| $ systemctl status sshd.service | $ systemctl status sshd.service | ||
| - | $ systemctl start sshd.service | + | $ sudo systemctl start sshd.service |
| </ | </ | ||
| Line 53: | Line 53: | ||
| ===== (Abbreviated) package contents and directory layout ===== | ===== (Abbreviated) package contents and directory layout ===== | ||
| - | References to man pages deleted for brevity. | + | References to man/doc pages and build IDs deleted for brevity. |
| + | |||
| + | **NOTE**: Executables under ''/ | ||
| ==== openssh-server ==== | ==== openssh-server ==== | ||
| Line 76: | Line 78: | ||
| / | / | ||
| / | / | ||
| - | / | ||
| / | / | ||
| </ | </ | ||
| Line 83: | Line 84: | ||
| < | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | ==== openssh ==== | ||
| + | |||
| + | < | ||
| + | /etc/ssh | ||
| + | / | ||
| + | / | ||
| + | / | ||
| </ | </ | ||
| + | |||
| + | Both higher-level packages depend on '' | ||
| + | |||
| + | < | ||
| + | $ rpm -qR openssh-server | ||
| + | $ rpm -qR openssh-clients | ||
| + | </ | ||
| + | ===== /etc/ssh/ system-wide SSH configuration ===== | ||
| + | |||
| + | Both system-wide client and server configuration. | ||
| + | |||
| + | < | ||
| + | $ ls -lF | ||
| + | total 564 | ||
| + | -rw-r--r--. 1 root root 541716 May 19 20:00 moduli | ||
| + | -rw-r--r--. 1 root root 1916 May 19 20:00 ssh_config | ||
| + | drwxr-xr-x. 2 root root 28 Oct 17 12:18 ssh_config.d/ | ||
| + | -rw-------. 1 root root 3674 May 19 20:00 sshd_config | ||
| + | drwx------. 2 root root 66 Oct 17 12:18 sshd_config.d/ | ||
| + | -rw-------. 1 root root 480 Oct 17 12:19 ssh_host_ecdsa_key | ||
| + | -rw-r--r--. 1 root root 162 Oct 17 12:19 ssh_host_ecdsa_key.pub | ||
| + | -rw-------. 1 root root 387 Oct 17 12:19 ssh_host_ed25519_key | ||
| + | -rw-r--r--. 1 root root 82 Oct 17 12:19 ssh_host_ed25519_key.pub | ||
| + | -rw-------. 1 root root 2578 Oct 17 12:19 ssh_host_rsa_key | ||
| + | -rw-r--r--. 1 root root 554 Oct 17 12:19 ssh_host_rsa_key.pub | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | $ sudo tree -F | ||
| + | ./ | ||
| + | ├── moduli | ||
| + | ├── ssh_config | ||
| + | ├── ssh_config.d/ | ||
| + | │ └── 50-redhat.conf | ||
| + | ├── sshd_config | ||
| + | ├── sshd_config.d/ | ||
| + | │ ├── 40-redhat-crypto-policies.conf | ||
| + | │ └── 50-redhat.conf | ||
| + | ├── ssh_host_ecdsa_key | ||
| + | ├── ssh_host_ecdsa_key.pub | ||
| + | ├── ssh_host_ed25519_key | ||
| + | ├── ssh_host_ed25519_key.pub | ||
| + | ├── ssh_host_rsa_key | ||
| + | └── ssh_host_rsa_key.pub | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== The SSH host keys ===== | ||
| + | |||
| + | Created in ''/ | ||
| + | |||
| + | < | ||
| + | $ ls -l ssh_host* | ||
| + | -rw-------. 1 root root 480 Oct 17 12:19 ssh_host_ecdsa_key | ||
| + | -rw-r--r--. 1 root root 162 Oct 17 12:19 ssh_host_ecdsa_key.pub | ||
| + | -rw-------. 1 root root 387 Oct 17 12:19 ssh_host_ed25519_key | ||
| + | -rw-r--r--. 1 root root 82 Oct 17 12:19 ssh_host_ed25519_key.pub | ||
| + | -rw-------. 1 root root 2578 Oct 17 12:19 ssh_host_rsa_key | ||
| + | -rw-r--r--. 1 root root 554 Oct 17 12:19 ssh_host_rsa_key.pub | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | Every SSH server has a static, unique cryptographic key pair consisting of a private host key (kept strictly secret on the server) and a public host key (shared with clients). | ||
| + | |||
| + | ===== sshd_config file ===== | ||
| + | |||
| + | < | ||
| + | # This is the sshd server system-wide configuration file. See | ||
| + | # sshd_config(5) for more information. | ||
| + | |||
| + | # This sshd was compiled with PATH=/ | ||
| + | |||
| + | # The strategy used for options in the default sshd_config shipped with | ||
| + | # OpenSSH is to specify options with their default value where | ||
| + | # possible, but leave them commented. | ||
| + | # default value. | ||
| + | |||
| + | # To modify the system-wide sshd configuration, | ||
| + | # / | ||
| + | Include / | ||
| + | |||
| + | # If you want to change the port on a SELinux system, you have to tell | ||
| + | # SELinux about this change. | ||
| + | # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER | ||
| + | # | ||
| + | #Port 22 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | #HostKey / | ||
| + | #HostKey / | ||
| + | #HostKey / | ||
| + | |||
| + | # Ciphers and keying | ||
| + | #RekeyLimit default none | ||
| + | |||
| + | # Logging | ||
| + | # | ||
| + | #LogLevel INFO | ||
| + | |||
| + | # Authentication: | ||
| + | |||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # | ||
| + | |||
| + | # The default is to check both .ssh/ | ||
| + | # but this is overridden so installations will only check .ssh/ | ||
| + | AuthorizedKeysFile | ||
| + | |||
| + | # | ||
| + | |||
| + | # | ||
| + | # | ||
| + | |||
| + | # For this to work you will also need host keys in / | ||
| + | # | ||
| + | # Change to yes if you don't trust ~/ | ||
| + | # HostbasedAuthentication | ||
| + | # | ||
| + | # Don't read the user's ~/.rhosts and ~/.shosts files | ||
| + | # | ||
| + | |||
| + | # To disable tunneled clear text passwords, change to no here! | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # Change to no to disable s/key passwords | ||
| + | # | ||
| + | |||
| + | # Kerberos options | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # GSSAPI options | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # Set this to ' | ||
| + | # and session processing. If this is enabled, PAM authentication will | ||
| + | # be allowed through the KbdInteractiveAuthentication and | ||
| + | # PasswordAuthentication. | ||
| + | # PAM authentication via KbdInteractiveAuthentication may bypass | ||
| + | # the setting of " | ||
| + | # If you just want the PAM account and session checks to run without | ||
| + | # PAM authentication, | ||
| + | # and KbdInteractiveAuthentication to ' | ||
| + | # WARNING: ' | ||
| + | # problems. | ||
| + | #UsePAM no | ||
| + | |||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | #PermitTTY yes | ||
| + | #PrintMotd yes | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | #UseDNS no | ||
| + | #PidFile / | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # no default banner path | ||
| + | #Banner none | ||
| + | |||
| + | # override default of no subsystems | ||
| + | Subsystem | ||
| + | |||
| + | # Example of overriding settings on a per-user basis | ||
| + | #Match User anoncvs | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | |||