redhat:ssh-redhat:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
redhat:ssh-redhat:start [2019/01/18 14:19] – [Equip SSH Logins with MOTD and SSH-Banner Messages] michaelredhat:ssh-redhat:start [2019/02/20 15:50] – [SSH für Key-Authentifizierung Konfigurieren und härten] michael
Line 1: Line 1:
 ====== Secure Shell - SSH unter Redhat / CentOS 7 ====== ====== Secure Shell - SSH unter Redhat / CentOS 7 ======
 +
 **SSH** (oder ausgeschrieben **Secure SHell**) ist ein Protokoll, welches eine sichere Kommunikation zwischen zwei Systemen mittels einer Client/Server Architektur ermöglicht.  **SSH** (oder ausgeschrieben **Secure SHell**) ist ein Protokoll, welches eine sichere Kommunikation zwischen zwei Systemen mittels einer Client/Server Architektur ermöglicht. 
  
Line 10: Line 11:
 **SSH** wurde als Ersatz für ältere, weniger sichere Terminalanwendungen, wie **rsh** entwickelt. Das Programm **scp** ersetzt ältere Programme wie **rcp**, die zum Kopieren von Dateien zwischen Hosts verwendet wurden. **SSH** wurde als Ersatz für ältere, weniger sichere Terminalanwendungen, wie **rsh** entwickelt. Das Programm **scp** ersetzt ältere Programme wie **rcp**, die zum Kopieren von Dateien zwischen Hosts verwendet wurden.
  
- 
----- 
  
  
Line 50: Line 49:
 </WRAP> </WRAP>
  
-----+
  
 ===== SSH für Key-Authentifizierung Konfigurieren und härten ===== ===== SSH für Key-Authentifizierung Konfigurieren und härten =====
Line 156: Line 155:
 </WRAP> </WRAP>
  
----- 
  
  
Line 165: Line 163:
  
  
-<wrap em>Hierfür gibt es zwei unterschiedliche Wege; also einmal das''**issue.net** file'' oder das ''**motd** file''.</wrap>+<WRAP center round tip 100%> 
 +''Hierfür gibt es zwei unterschiedliche Wege; also einmal das **issue.net** file oder das **motd** file''.
  
   * ''**motd** : Zeigt eine Banner Message gleich nach dem erfolgreichen Login an.''   * ''**motd** : Zeigt eine Banner Message gleich nach dem erfolgreichen Login an.''
   * ''**issue.net** : Zeigt ein Banner noch vor der Password Login-prompt.''   * ''**issue.net** : Zeigt ein Banner noch vor der Password Login-prompt.''
 +</WRAP>
  
-I strongly recommended all system administrator to display a banner messages before allowing users to log in to systems. 
  
  
 +<WRAP center box 100%>
 +==== motd - Display SSH Warning Message - After User Login ====
  
 +Das Akronym **motd** steht für message of the day. Diese Datei, welche vom Login-Programm benutzt wird, befindet sich im Konfigurationsverzeichnis unter ''/etc/motd'' und gibt nach einem erfolgreichem Login - aber noch vor dem Start der jeweiligen Login-Shell - eine Meldung aus.
  
 +Zur Information für etwaige Neugierige und Remoteuser, oder beides, je nach Betrachtungsweise, wollen wir hier nun noch ein paar Zusatzinformation ausgeben.
  
-==== Display SSH Warning Message - Before User Login ==== +<code># vim /etc/motd</code>
-To display Welcome or Warning message for SSH users before login; We use ''**issue.net** file'' to display banner massages. To configure this, follow this steps:+
  
 +<sxh plain;>
 + ##############################################################################
 + #                                                                            #
 + #                 This is the admin server of Michael Reber.                 #
 + #                                                                            #
 + #                                ATTENTION:                                  #
 + #                                                                            #
 + #             Unauthorized access to this system is prohibited !             #
 + #                                                                            #
 + #    This system is actively monitored and all connections may be logged.    #
 + #         By accessing this system, you consent to this monitoring.          #
 + #                                                                            #
 + ##############################################################################
 +</sxh>
 +
 +War die Datei zuvor noch nicht vorhanden, so passen wir die Berechtigungen noch wie folgt an:
 +
 +<code># chown root:root /etc/motd
 +# chmod 644 /etc/motd</code>
 +
 +</WRAP>
 +
 +
 +<WRAP center box 100%>
 +==== issue.net - Display SSH Warning Message - Before User Login ====
 +
 +Mit Hilfe dieser Datei ''/etc/issue.net'' können ebenfalls Meldungen am Bildschirm ausgegeben werden - diese Informationen erscheinen dann jedoch vor dem Login-Prompt - sobald man sich via ssh anmelden möchte. Hierzu legen wir einfach die Datei ''/etc/issue.net'' mit dem editor unserer Wahl an.
  
-  - **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%> 
 <code> <code>
 # vim /etc/issue.net # vim /etc/issue.net
 </code> </code>
- 
 <sxh plain;> <sxh plain;>
-############################################################### + ############################################################################## 
-                 Welcome to blackGATE.com                   + #                                                                            # 
-                                                            + #                       This is a private home server                      
-        All connections are monitored and recorded          + #                                                                            
- Disconnect IMMEDIATELY if you are not an authorized user!  + #             Unauthorized access to this system is prohibited !             # 
-############################################################### + #                                                                            # 
 + #    This system is actively monitored and all connections may be logged.    
 + #         By accessing this system, you consent to this monitoring.          
 + #                                                                            # 
 + ##############################################################################
 </sxh> </sxh>
-</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 /etc/issue.net 
 +</code> 
 + 
 +Abschliessend ergänzen wir noch in der ''/etc/ssh/sshd_config'' die BANNER Konfiguration. 
 <code> <code>
 # vim /etc/ssh/sshd_config # vim /etc/ssh/sshd_config
Line 206: Line 244:
 Banner /etc/issue.net   #(you can use any path you want) Banner /etc/issue.net   #(you can use any path you want)
 </sxh> </sxh>
-</WRAP> 
-  - **Finally, restart the SSH daemon** to reflect new changes. <code># systemctl restart sshd</code> 
-  - <wrap em>Try to connect to server you will see banner message, similar to below</wrap>. 
  
 +Nun fehlt nur noch der Restart des SSH Daemon:
 +
 +<code># systemctl restart sshd</code>
 +</WRAP>
  
-==== Display SSH Warning Message - After User Login ==== 
  
  
  • redhat/ssh-redhat/start.txt
  • Last modified: 2020/09/03 12:12
  • by michael