Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
redhat:ssh-redhat:start [2017/08/22 16:11] – [SSH für Key-Authentifizierung Konfigurieren] michael | redhat:ssh-redhat:start [2020/09/03 12:12] (current) – michael | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Secure Shell - SSH unter Redhat / CentOS ====== | + | ====== Secure Shell - SSH unter Redhat / CentOS |
- | **SSH** (oder ausgeschrieben **Secure SHell**) ist ein Protokoll, welches eine sichere Kommunikation zwischen zwei Systemen mittels einer Client/ | + | |
+ | **SSH** (oder ausgeschrieben **Secure SHell**) ist ein Protokoll, welches eine sichere Kommunikation zwischen zwei Systemen mittels einer Client/ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Die Benutzer können sich damit auch bei einem entfernten Host-System anmelden und dies anschliessend mit den Berechtigungen des lokal eingeloggten Users verwalten. | ||
Im Gegensatz zu anderen Remote-Kommunikationsprotokollen wie FTP oder Telnet, verschlüsselt SSH die Anmeldung. Auf diese Weise können Eindringlinge auch keine unverschlüsselten Passwörter erkennen. | Im Gegensatz zu anderen Remote-Kommunikationsprotokollen wie FTP oder Telnet, verschlüsselt SSH die Anmeldung. Auf diese Weise können Eindringlinge auch keine unverschlüsselten Passwörter erkennen. | ||
Line 6: | Line 11: | ||
**SSH** wurde als Ersatz für ältere, weniger sichere Terminalanwendungen, | **SSH** wurde als Ersatz für ältere, weniger sichere Terminalanwendungen, | ||
- | |||
- | ---- | ||
- | ===== openSSH | + | ===== OpenSSH |
Die für die **Secure-Shell** benötigten Pakete werden im optimal Fall bereits bei der Erstinstallation erfolgreich ins System installiert. Bei Redhat teilen sich die einzelnen Programme der Programmsuite auf folgende Pakete auf: | Die für die **Secure-Shell** benötigten Pakete werden im optimal Fall bereits bei der Erstinstallation erfolgreich ins System installiert. Bei Redhat teilen sich die einzelnen Programme der Programmsuite auf folgende Pakete auf: | ||
Line 42: | Line 45: | ||
... | ... | ||
</ | </ | ||
+ | |||
+ | '' | ||
</ | </ | ||
- | Das gleiche könnten wir nun auch für das **openssh-clients** Paket, den **openssh-server** oder den **openssh-askpass** durchführen. So erkennen man, welche openssh Teile von welchen Paket zur Verfügung gestellt werden. | ||
- | ---- | ||
- | ===== SSH für Key-Authentifizierung Konfigurieren ===== | + | ===== SSH für Key-Authentifizierung Konfigurieren |
Sobald man einen **Fernzugriff** auf seine **Linux-Systeme**, | Sobald man einen **Fernzugriff** auf seine **Linux-Systeme**, | ||
Line 152: | Line 155: | ||
</ | </ | ||
- | ---- | ||
- | ===== Protect SSH Logins with SSH & MOTD Banner Messages ===== | ||
- | One of the easiest way to protect and secure SSH logins by displaying warming message to UN-authorized users or display welcome or informational messages to authorized users. | ||
- | Being a system administrator whenever configure Linux servers I always use to configure a security banners for ssh logins. The banner contains some security warning information or general information. See my example banner message which I used for my all servers. | ||
- | <WRAP center round box 100%> | + | ===== Equip SSH Logins with MOTD or SSH-Banner Messages ===== |
- | '' | + | |
- | This service is restricted to authorized users only. All activities on this system are logged. | + | Vor - und nach einem LOGIN auf unser System können wir dem Nutzer noch individuelle Informationen anzeigen und/oder mitgeben. |
- | Unauthorized access will be fully investigated and reported to the appropriate law enforcement agencies.//'' | + | |
+ | |||
+ | <WRAP center round tip 100%> | ||
+ | '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
</ | </ | ||
- | <wrap em>There are two way to display messages one is using '' | ||
- | * '' | + | <WRAP center box 100%> |
- | * '' | + | ==== motd - Display |
- | So, I strongly recommended all system administrator to display a banner messages before allowing users to log in to systems. Just follow below simple steps to enable SSH logging messages. | + | Das Akronym **motd** steht für message of the day. Diese Datei, welche vom Login-Programm benutzt wird, befindet sich im Konfigurationsverzeichnis unter ''/ |
+ | Zur Information für etwaige Neugierige und Remoteuser, oder beides, je nach Betrachtungsweise, | ||
- | https://dokuwiki.nausch.org/doku.php/ | + | < |
- | FIXME | + | |
- | ==== Display SSH Warning Message - Before User Login ==== | + | <sxh plain;> |
- | To display Welcome or Warning message for SSH users before login; We use '' | + | ############################################################################## |
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | ############################################################################## | ||
+ | </ | ||
+ | |||
+ | War die Datei zuvor noch nicht vorhanden, so passen wir die Berechtigungen noch wie folgt an: | ||
+ | |||
+ | < | ||
+ | # chmod 644 / | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP center box 100%> | ||
+ | ==== issue.net - Display SSH Warning Message - Before User Login ==== | ||
+ | Mit Hilfe dieser Datei ''/ | ||
- | - **Add the this banner sample message and save the file.** //You can add as well any custom banner message to this file.// <WRAP center box 100%> | ||
< | < | ||
# vim / | # vim / | ||
</ | </ | ||
- | |||
<sxh plain;> | <sxh plain;> | ||
- | ############################################################### | + | ############### |
- | # | + | # |
- | # | + | # |
- | # All connections are monitored and recorded | + | # |
- | # | + | # |
- | ############################################################### | + | # |
+ | # | ||
+ | # | ||
+ | # # | ||
+ | ############### | ||
</ | </ | ||
- | </WRAP> | + | |
- | - **Open the master ssh configuration file and enable banners**. <WRAP center box 100%> | + | Die Berechtigungen passen wir dann wie folgt an: |
+ | |||
+ | <code> | ||
+ | # chown root:root /etc/issue.net | ||
+ | # chmod 644 / | ||
+ | </code> | ||
+ | |||
+ | Abschliessend ergänzen wir noch in der ''/ | ||
< | < | ||
# vim / | # vim / | ||
Line 207: | Line 244: | ||
Banner / | Banner / | ||
</ | </ | ||
- | </ | ||
- | - **Finally, restart the SSH daemon** to reflect new changes. < | ||
- | - <wrap em>Try to connect to server you will see banner message, similar to below</ | ||
+ | Nun fehlt nur noch der Restart des SSH Daemon: | ||
+ | |||
+ | < | ||
+ | </ | ||
- | ==== Display SSH Warning Message - After User Login ==== | ||