ssh_ssl
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| ssh_ssl [2022-06-07 00:38:52] – [SSH / SSL] manfred | ssh_ssl [2024-07-27 22:28:01] (aktuell) – david | ||
|---|---|---|---|
| Zeile 3: | Zeile 3: | ||
| * [[http:// | * [[http:// | ||
| * **[[SSH-Schlüssel austauschen für ein passwortlosen Login]]** | * **[[SSH-Schlüssel austauschen für ein passwortlosen Login]]** | ||
| - | * [[SSL-Schlüssel generieren]] | + | * [[OpenSSL]] |
| - | * [[Let's Encrypt]] | + | * [[::EDV:SSL-Schlüssel generieren]] |
| + | * [[letsencrypt]] | ||
| * [[einzelne Dateien mit openSSL verschlüsseln]] | * [[einzelne Dateien mit openSSL verschlüsseln]] | ||
| * [[Datenbankverbindungen zu einer MySQL mit SSL-Verschlüsselung]] | * [[Datenbankverbindungen zu einer MySQL mit SSL-Verschlüsselung]] | ||
| Zeile 10: | Zeile 11: | ||
| * [[SCP-only mit Change Root]] | * [[SCP-only mit Change Root]] | ||
| * [[SFTP-User mit Change Root]] | * [[SFTP-User mit Change Root]] | ||
| - | * Datenaustausch zwischen **Android** ([[https:// | + | * Datenaustausch zwischen **Android** ([[https:// |
| - | * dafür muß auf dem **FreeBSD-Server** folgendes eingestellt werden: | + | |
| - | * '' | + | |
| - | * //login:// '' | + | |
| - | * //login:// '' | + | |
| - | * // | + | |
| - | * // | + | |
| - | * // | + | |
| * [[SSH/BASH mit Change Root]] | * [[SSH/BASH mit Change Root]] | ||
| * [[SSH-Tunnel]] | * [[SSH-Tunnel]] | ||
| + | * [[http:// | ||
| * __**[[SSH/ | * __**[[SSH/ | ||
| - | * '' | + | |
| - | * '' | + | |
| + | * '' | ||
| + | | ||
| + | | ||
| + | * '' | ||
| * '' | * '' | ||
| * '' | * '' | ||
| Zeile 31: | Zeile 30: | ||
| * '' | * '' | ||
| * [[Fehler: Gesicherte Verbindung fehlgeschlagen]] | * [[Fehler: Gesicherte Verbindung fehlgeschlagen]] | ||
| - | |||
| - | * [[http:// | ||
| Zeile 107: | Zeile 104: | ||
| ===== SSH Config ===== | ===== SSH Config ===== | ||
| - | Beispiel Konfiguration, | + | Beispiel Konfiguration, |
| <code yaml ~/ | <code yaml ~/ | ||
| # | # | ||
| Zeile 113: | Zeile 110: | ||
| #ssh -Q help | #ssh -Q help | ||
| - | HOST * | + | Host * |
| #ssh -Q sig | #ssh -Q sig | ||
| CASignatureAlgorithms ssh-ed25519, | CASignatureAlgorithms ssh-ed25519, | ||
| Zeile 132: | Zeile 129: | ||
| </ | </ | ||
| - | alle 30s ein Nullpaket (keep-alive) an den Server senden (hier bis zu 30 Mal) | + | Alle 3s ein Nullpaket (keep-alive) an den Server senden (hier bis zu 10 Mal) |
| <code yaml ~/ | <code yaml ~/ | ||
| - | HOST * | + | Host * |
| - | | + | |
| - | | + | |
| + | TCPKeepAlive yes | ||
| </ | </ | ||
| - | Für den Host example.com einen anderen Standard-Port verwenden (hier: 2222) | + | Andere Config-Dateien einlesen |
| <code yaml ~/ | <code yaml ~/ | ||
| - | HOST example.com | + | Include config.d/ |
| + | |||
| + | </ | ||
| + | |||
| + | Für den Host example.com einen anderen Standard-Port verwenden (hier: 2222) | ||
| + | <code yaml ~/ | ||
| + | Host example.com | ||
| Port 2222 | Port 2222 | ||
| Zeile 149: | Zeile 153: | ||
| ===== SSHD Config ===== | ===== SSHD Config ===== | ||
| + | |||
| + | siehe [[https:// | ||
| + | |||
| + | ==== komplette Beispiel-Config ==== | ||
| + | |||
| + | |||
| + | === Unix-like === | ||
| + | |||
| + | <code yaml / | ||
| + | Port 22 | ||
| + | AddressFamily any | ||
| + | ListenAddress 0.0.0.0 | ||
| + | ListenAddress :: | ||
| + | |||
| + | PermitRootLogin prohibit-password | ||
| + | |||
| + | PubkeyAuthentication yes | ||
| + | AuthorizedKeysFile .ssh/ | ||
| + | |||
| + | HostbasedAuthentication no | ||
| + | |||
| + | PasswordAuthentication no | ||
| + | PermitEmptyPasswords no | ||
| + | |||
| + | KbdInteractiveAuthentication no | ||
| + | ChallengeResponseAuthentication no | ||
| + | KerberosAuthentication no | ||
| + | GSSAPIAuthentication no | ||
| + | |||
| + | UsePAM yes | ||
| + | |||
| + | X11Forwarding yes | ||
| + | PrintMotd no | ||
| + | PrintLastLog yes | ||
| + | TCPKeepAlive yes | ||
| + | ClientAliveInterval 10 | ||
| + | ClientAliveCountMax 3 | ||
| + | VersionAddendum none | ||
| + | Banner none | ||
| + | # Debian only | ||
| + | DebianBanner no | ||
| + | |||
| + | Subsystem sftp internal-sftp -u 0022 | ||
| + | |||
| + | Match User mm | ||
| + | AllowTcpForwarding no | ||
| + | ChrootDirectory /public/mm | ||
| + | ForceCommand internal-sftp | ||
| + | PasswordAuthentication yes | ||
| + | PermitTTY no | ||
| + | X11Forwarding no | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Windows === | ||
| + | |||
| + | <code yaml C:/ | ||
| + | Port 22 | ||
| + | Port 23 | ||
| + | AddressFamily any | ||
| + | ListenAddress 0.0.0.0 | ||
| + | ListenAddress :: | ||
| + | |||
| + | PermitRootLogin prohibit-password | ||
| + | |||
| + | PubkeyAuthentication yes | ||
| + | AuthorizedKeysFile .ssh/ | ||
| + | |||
| + | HostbasedAuthentication no | ||
| + | |||
| + | PasswordAuthentication no | ||
| + | PermitEmptyPasswords no | ||
| + | |||
| + | KbdInteractiveAuthentication no | ||
| + | ChallengeResponseAuthentication no | ||
| + | GSSAPIAuthentication no | ||
| + | |||
| + | PrintMotd yes | ||
| + | PrintLastLog yes | ||
| + | TCPKeepAlive yes | ||
| + | ClientAliveInterval 10 | ||
| + | ClientAliveCountMax 3 | ||
| + | VersionAddendum none | ||
| + | Banner none | ||
| + | |||
| + | Subsystem sftp internal-sftp | ||
| + | |||
| + | #Match Group administrators | ||
| + | # AuthorizedKeysFile __PROGRAMDATA__/ | ||
| + | |||
| + | # configure pwsh as default shell (run command in pwsh as admin): | ||
| + | # New-ItemProperty -Path " | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Zugriff ==== | ||
| + | |||
| + | Port 22 und 23 (z.B. extern nur 23 erlauben und intern 22 nutzen) | ||
| + | |||
| + | <code yaml / | ||
| + | Port 22 | ||
| + | Port 23 | ||
| + | AddressFamily any | ||
| + | ListenAddress 0.0.0.0 | ||
| + | ListenAddress :: | ||
| + | </ | ||
| + | |||
| + | |||
| + | Port 22 (IPv4+IPv6) und 23 (IPv6) (gleiches Beispiel wie oben, falls man im Router eine IPv4 Portweiterleitung über NAT umleiten will) | ||
| <code yaml / | <code yaml / | ||
| #Port 22 | #Port 22 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| ListenAddress 0.0.0.0:22 | ListenAddress 0.0.0.0:22 | ||
| ListenAddress [::]:22 | ListenAddress [::]:22 | ||
| Zeile 157: | Zeile 273: | ||
| </ | </ | ||
| + | === Allgemein === | ||
| + | | ||
| <code yaml / | <code yaml / | ||
| - | # root login only with key | ||
| PermitRootLogin prohibit-password | PermitRootLogin prohibit-password | ||
| - | # root login allowed | ||
| - | PermitRootLogin yes | ||
| PubkeyAuthentication yes | PubkeyAuthentication yes | ||
| - | PasswordAuthentication | + | PasswordAuthentication |
| PermitEmptyPasswords no | PermitEmptyPasswords no | ||
| ChallengeResponseAuthentication no | ChallengeResponseAuthentication no | ||
| Zeile 171: | Zeile 286: | ||
| PrintLastLog yes | PrintLastLog yes | ||
| </ | </ | ||
| + | |||
| + | ==== SFTP ==== | ||
| + | |||
| + | Um die Standard umask zu verwenden einfach '-u 0022' weglassen | ||
| <code yaml / | <code yaml / | ||
| - | # omit '-u 0022' to use default umask | + | # internal sftp (recommended) |
| - | # Ubuntu | + | Subsystem sftp internal-sftp |
| - | Subsystem | + | |
| - | #FreeBSD | + | # external sftp |
| - | Subsystem | + | |
| + | ## Debian/Ubuntu | ||
| + | Subsystem sftp / | ||
| + | |||
| + | ## FreeBSD | ||
| + | Subsystem sftp / | ||
| </ | </ | ||
| Zeile 257: | Zeile 382: | ||
| RSA mit großer Schlüssellänge ist z.Z. die sicherste Alternative. | RSA mit großer Schlüssellänge ist z.Z. die sicherste Alternative. | ||
| - | der ED25519-Schlüssel hat eine __feste Länge von 256 Bit__, hier wird die Option '' | + | der ED25519-Schlüssel hat eine __feste Länge von 256 Bit__, hier wird die Option '' |
| > ssh-keygen -t ed25519 -a 1024 | > ssh-keygen -t ed25519 -a 1024 | ||
/home/http/wiki/data/attic/ssh_ssl.1654562332.txt · Zuletzt geändert: von manfred
