Linux-Server/Clients: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 7: Zeile 7:
 
{{#drawio:linux-server-client}}
 
{{#drawio:linux-server-client}}
  
= Servers =
+
* [[Server|Beispiele]]
 +
 
 +
= Laufende Dienste anzeigen =
 +
 
 +
* Es empfiehlt sich diese Befehle als root zu machen, damit auch alles angezeigt wird
 +
* '''ss -ltp'''
 +
 
 +
State          Recv-Q        Send-Q        Local Address:Port        Peer Address:Port        Process
 +
LISTEN        0              128              127.0.0.1:ipp              0.0.0.0:*            users:(("cupsd",pid=482,fd=9))
 +
LISTEN        0              128                0.0.0.0:ssh              0.0.0.0:*            users:(("sshd",pid=483,fd=3))
 +
LISTEN        0              128              127.0.0.1:5939            0.0.0.0:*            users:(("teamviewerd",pid=608,fd=13))
 +
LISTEN        0              4096                0.0.0.0:llmnr            0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=12))
 +
LISTEN        0              4096            127.0.0.54:domain          0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=20))
 +
LISTEN        0              4096          127.0.0.53%lo:domain          0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=18))
 +
LISTEN        0              128                    [::]:ssh                [::]:*            users:(("sshd",pid=483,fd=4))
 +
LISTEN        0              128                  [::1]:ipp                [::]:*            users:(("cupsd",pid=482,fd=8))
 +
LISTEN        0              4096                  [::]:llmnr              [::]:*            users:(("systemd-resolve",pid=393,fd=14))
 +
;oder
 +
 
 +
* '''netstat -ltp'''
 +
 
 +
Active Internet connections (only servers)
 +
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name
 +
tcp        0      0 localhost:ipps          0.0.0.0:*              LISTEN      482/cupsd
 +
tcp        0      0 0.0.0.0:ssh            0.0.0.0:*              LISTEN      483/sshd: /usr/bin/
 +
tcp        0      0 localhost:5939          0.0.0.0:*              LISTEN      608/teamviewerd
 +
tcp        0      0 0.0.0.0:llmnr          0.0.0.0:*              LISTEN      393/systemd-resolve
 +
tcp        0      0 localhost:domain        0.0.0.0:*              LISTEN      393/systemd-resolve
 +
tcp        0      0 localhost:domain        0.0.0.0:*              LISTEN      393/systemd-resolve
 +
tcp6      0      0 [::]:ssh                [::]:*                  LISTEN      483/sshd: /usr/bin/
 +
tcp6      0      0 localhost:ipps          [::]:*                  LISTEN      482/cupsd
 +
tcp6      0      0 [::]:llmnr              [::]:*                  LISTEN      393/systemd-resolve
 +
;ohne Befragung der ''/etc/services''
 +
 
 +
* '''ss -ltpn'''
 +
 
 +
State          Recv-Q      Send-Q      Local Address:Port        Peer Address:Port        Process
 +
LISTEN        0            128            127.0.0.1:631              0.0.0.0:*            users:(("cupsd",pid=482,fd=9))
 +
LISTEN        0            128              0.0.0.0:22              0.0.0.0:*            users:(("sshd",pid=483,fd=3))
 +
LISTEN        0            128            127.0.0.1:5939            0.0.0.0:*            users:(("teamviewerd",pid=608,fd=13))
 +
LISTEN        0            4096              0.0.0.0:5355            0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=12))
 +
LISTEN        0            4096          127.0.0.54:53              0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=20))
 +
LISTEN        0            4096        127.0.0.53%lo:53              0.0.0.0:*            users:(("systemd-resolve",pid=393,fd=18))
 +
LISTEN        0            128                  [::]:22                  [::]:*            users:(("sshd",pid=483,fd=4))
 +
LISTEN        0            128                [::1]:631                [::]:*            users:(("cupsd",pid=482,fd=8))
 +
LISTEN        0            4096                [::]:5355                [::]:*            users:(("systemd-resolve",pid=393,fd=14))
 +
 
 +
= Befehle für das Senden von Client-Anfragen =
 +
 
 +
* [[netcat]]
 +
* [[curl]]

Aktuelle Version vom 3. März 2023, 09:53 Uhr

Prinzip

  • Die generelle Beziehung zwischen Server und Client
  • Es können auch mehrere Sockets involviert sein (z.B. FTP)
  • Verbindungen können lokal oder über ein Netzwerk laufen

Laufende Dienste anzeigen

  • Es empfiehlt sich diese Befehle als root zu machen, damit auch alles angezeigt wird
  • ss -ltp
State          Recv-Q         Send-Q        Local Address:Port        Peer Address:Port         Process
LISTEN         0              128               127.0.0.1:ipp              0.0.0.0:*             users:(("cupsd",pid=482,fd=9))
LISTEN         0              128                 0.0.0.0:ssh              0.0.0.0:*             users:(("sshd",pid=483,fd=3))
LISTEN         0              128               127.0.0.1:5939             0.0.0.0:*             users:(("teamviewerd",pid=608,fd=13))
LISTEN         0              4096                0.0.0.0:llmnr            0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=12))
LISTEN         0              4096             127.0.0.54:domain           0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=20))
LISTEN         0              4096          127.0.0.53%lo:domain           0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=18))
LISTEN         0              128                    [::]:ssh                 [::]:*             users:(("sshd",pid=483,fd=4))
LISTEN         0              128                   [::1]:ipp                 [::]:*             users:(("cupsd",pid=482,fd=8))
LISTEN         0              4096                   [::]:llmnr               [::]:*             users:(("systemd-resolve",pid=393,fd=14))
oder
  • netstat -ltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 localhost:ipps          0.0.0.0:*               LISTEN      482/cupsd
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      483/sshd: /usr/bin/
tcp        0      0 localhost:5939          0.0.0.0:*               LISTEN      608/teamviewerd
tcp        0      0 0.0.0.0:llmnr           0.0.0.0:*               LISTEN      393/systemd-resolve
tcp        0      0 localhost:domain        0.0.0.0:*               LISTEN      393/systemd-resolve
tcp        0      0 localhost:domain        0.0.0.0:*               LISTEN      393/systemd-resolve
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      483/sshd: /usr/bin/
tcp6       0      0 localhost:ipps          [::]:*                  LISTEN      482/cupsd
tcp6       0      0 [::]:llmnr              [::]:*                  LISTEN      393/systemd-resolve
ohne Befragung der /etc/services
  • ss -ltpn
State          Recv-Q       Send-Q      Local Address:Port        Peer Address:Port         Process
LISTEN         0            128             127.0.0.1:631              0.0.0.0:*             users:(("cupsd",pid=482,fd=9))
LISTEN         0            128               0.0.0.0:22               0.0.0.0:*             users:(("sshd",pid=483,fd=3))
LISTEN         0            128             127.0.0.1:5939             0.0.0.0:*             users:(("teamviewerd",pid=608,fd=13))
LISTEN         0            4096              0.0.0.0:5355             0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=12))
LISTEN         0            4096           127.0.0.54:53               0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=20))
LISTEN         0            4096        127.0.0.53%lo:53               0.0.0.0:*             users:(("systemd-resolve",pid=393,fd=18))
LISTEN         0            128                  [::]:22                  [::]:*             users:(("sshd",pid=483,fd=4))
LISTEN         0            128                 [::1]:631                 [::]:*             users:(("cupsd",pid=482,fd=8))
LISTEN         0            4096                 [::]:5355                [::]:*             users:(("systemd-resolve",pid=393,fd=14))

Befehle für das Senden von Client-Anfragen