445 lines
14 KiB
HTML
445 lines
14 KiB
HTML
|
<!doctype html>
|
||
|
<html lang="de">
|
||
|
<meta charset="utf-8">
|
||
|
|
||
|
<title>Einführung in Linux</title>
|
||
|
|
||
|
<meta name="description" content="YALC - Yet Another Linux Course ">
|
||
|
<meta name="author" content="Daniel Schubert">
|
||
|
|
||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||
|
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||
|
|
||
|
<link rel="stylesheet" href="css/reveal.css">
|
||
|
<link rel="stylesheet" href="css/theme/league.css" id="theme">
|
||
|
|
||
|
<link rel="icon" href="img/openlogo-nd-25.png" type="img/png">
|
||
|
|
||
|
<!-- Theme used for syntax highlighting of code -->
|
||
|
<link rel="stylesheet" href="lib/css/zenburn.css">
|
||
|
|
||
|
<!-- Printing and PDF exports -->
|
||
|
<script>
|
||
|
var link = document.createElement( 'link' );
|
||
|
link.rel = 'stylesheet';
|
||
|
link.type = 'text/css';
|
||
|
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
|
||
|
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
||
|
</script>
|
||
|
<style type="text/css">
|
||
|
.reveal img{ max-height: 60vh}
|
||
|
</style>
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div class="reveal">
|
||
|
<!-- Any section element inside of this container is displayed as a slide -->
|
||
|
<div class="slides">
|
||
|
|
||
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="zoom">
|
||
|
<h1>LINUX</h1>
|
||
|
<h3>Das universelle Betriebssystem</h3>
|
||
|
<p>Eine Einführung - Teil 12
|
||
|
<p> <small>Deutsche Angestellten Akademie</small> </p>
|
||
|
<aside class="notes">
|
||
|
Frage: Fragen zur letzten Stunde?
|
||
|
</aside>
|
||
|
</section>
|
||
|
|
||
|
<section><h3>screen</h3>
|
||
|
Ein Terminal Multiplexer
|
||
|
|
||
|
<ul>
|
||
|
<li class="fragment ">erzeugt mehrere virtuelle Konsolen</li>
|
||
|
<li class="fragment ">nützlich bei ssh Sitzungen</li>
|
||
|
<li class="fragment ">abgebrochene Sitzungen können fortgesetzt werden</li>
|
||
|
<li class="fragment "><pre><code class="bash">~$ sudo apt install screen && screen</code></pre></li>
|
||
|
</ul>
|
||
|
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<table style="font-size: .6em">
|
||
|
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td class="heise-table-title" colspan="2" style="text-align:center;">
|
||
|
Gängige screen-Kommandos
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A a</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
Strg-A senden (Cursor am Zeilenanfang positionieren)
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A c</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
neues Fenster öffnen
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A n</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
zum nächsten Fenster wechseln
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A p</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
zum vorigen Fenster wechseln
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A w</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
Titel aller Fenster anzeigen
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A “</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
Fenster-Menü einblenden
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A ?</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
Hilfe einblenden
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A x</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
Terminal sperren
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A k</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
aktuelles Fenster schließen („kill“)
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A 0</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
zum Fenster 0 ...
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A 9</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
... bis 9 wechseln
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A d</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
screen in den Hintergrund schicken („detach“)
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="heise-table-header" style="text-align:left;">
|
||
|
<strong>Strg-A [</strong>
|
||
|
</td>
|
||
|
<td style="text-align:left;">
|
||
|
in den Kopier/Scroll-Modus wechseln
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<aside class="notes"> ^a d </aside>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>Eine Sitzung wieder aufnehmen:
|
||
|
<div ><pre><code class=bash>~$ screen -ls
|
||
|
There are screens on:
|
||
|
10104.pts-0.laptopdan (05.02.2019 11:11:36) (Detached)
|
||
|
9108.pts-0.laptopdan (05.02.2019 11:06:29) (Detached)
|
||
|
2 Sockets in /run/screen/S-dany.
|
||
|
|
||
|
|
||
|
~$ screen -r 10104.pts-0.laptopdan</code></pre>
|
||
|
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<span style="color: orange">Aufgabe:</span>
|
||
|
<ul>
|
||
|
<li>beginnt eine screen Sitzung auf dem Server lk.schubertdaniel.de</li>
|
||
|
<li>öffnet in screen mit einem Editor eine beliebige Datei</li>
|
||
|
<li>detached die screen Sitzung mit „CTL-a d“</li>
|
||
|
<li>meldet euch vom server ab</li>
|
||
|
<li>meldet euch wieder beim server an</li>
|
||
|
<li>re-attached euch mit der screen Sitzung</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<a href="https://wiki.ubuntuusers.de/Screen/">https://wiki.ubuntuusers.de/Screen/</a>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>Alternativen zu screen:
|
||
|
<ul>
|
||
|
<li>tmux</li>
|
||
|
<li>byobu -> screen in hübsch</li>
|
||
|
</ul>
|
||
|
<hr>
|
||
|
<p>Sonstige Helferlein
|
||
|
<ul>
|
||
|
<li>terminator -> kann befehle an mehrere Server zugleich senden</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
|
||
|
<section data-transition="slide" data-background="#b5533c" data-background-transition="convex">
|
||
|
<h3>sshd - der SSH-Server-Daemon</h3>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<pre><code class="bash">~$ sudo apt-get install openssh-server</code></pre>
|
||
|
<pre><code class="bash">~$ ssh localhost</code></pre>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<h4>ssh Server absichern</h4>
|
||
|
<code>/etc/ssh/sshd_config</code>
|
||
|
<pre><code class=bash>
|
||
|
# https://de.wikipedia.org/wiki/Liste_der_standardisierten_Ports
|
||
|
Port 64322
|
||
|
|
||
|
# root login verbieten
|
||
|
PermitRootLogin no
|
||
|
|
||
|
# anmeldung nur mit ssh-key erlauben
|
||
|
PasswordAuthentication no
|
||
|
</code></pre>
|
||
|
</section>
|
||
|
|
||
|
<section><h4>fail2ban</h4>
|
||
|
<a href="https://www.thomas-krenn.com/de/wiki/SSH_Login_unter_Debian_mit_fail2ban_absichern">https://www.thomas-krenn.com/de/wiki/SSH_Login_unter_Debian_mit_fail2ban_absichern</a></section>
|
||
|
|
||
|
<section>
|
||
|
<span style="color: orange">Fingerübung:</span>
|
||
|
<ul>
|
||
|
<li>baut ein Script welches die fail2ban Filterregel auslöst</li>
|
||
|
<li>durch viele Anmeldeversuche in kurzer Zeit</li>
|
||
|
<li>seht euch die entsprechenden Log-Files an </li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
|
||
|
<section><h4>Firewall</h4>
|
||
|
<ul>
|
||
|
<li >iptables</li>
|
||
|
<li >nftables</li>
|
||
|
<li>shorewall</li>
|
||
|
<li>GUI : gufw </li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
|
||
|
<section data-transition="slide" data-background="#b5533c" data-background-transition="convex">
|
||
|
<h3>Programme zur Netzwerk Analyse</h3>
|
||
|
</section>
|
||
|
|
||
|
|
||
|
<section>
|
||
|
<pre><code class="bash">#zeige tcp verbindungen
|
||
|
~$ ss -tp
|
||
|
# zeige offene ports
|
||
|
~$ ss -tl
|
||
|
~$ ss -tulpe
|
||
|
~$ ss -s
|
||
|
|
||
|
~$ watch -n 1 "ss -t state syn-sent"
|
||
|
|
||
|
# netstat liefert im Prinzip dasselbe, gilt als veraltet
|
||
|
~$ netstat -tulpe
|
||
|
~$ netstat -s
|
||
|
</code></pre> </li>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<pre><code class="bash">~$ traceroute omikron.net</code></pre>
|
||
|
<pre><code class="bash">~$ traceroute6 omikron.net</code></pre>
|
||
|
<pre><code class="bash">~$ ping -a -c3 omikron.net</code></pre>
|
||
|
<pre><code class="bash">~$ ping6 -c3 omikron.net</code></pre>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>nslookup, dig, whois
|
||
|
<pre><code class="bash"># eine ip Adresse bei Quad9 nachfragen:
|
||
|
# dig tut dasselbe..
|
||
|
~$ nslookup -query=AAAA schubertdaniel.de 2620:fe::fe
|
||
|
</code></pre>
|
||
|
<pre><code class="bash"># gab vor Einführung der DSGVO Name und
|
||
|
# Adresse des domain Inhabers aus...
|
||
|
~$ whois schubertdaniel.de</code></pre>
|
||
|
<div class="fragment">
|
||
|
<p>in USA geht das noch über die ICANN :
|
||
|
<a href="https://whois.icann.org/en/lookup?name=google.com">https://whois.icann.org/en/lookup?name=google.com</a>
|
||
|
</div>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>nmap -> Portscanning
|
||
|
<pre><code class="bash">~$ nmap -A -T4 schubertdaniel.de</code></pre>
|
||
|
<a href="https://nmap.org/man/de/">https://nmap.org/man/de/</a>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<h4>GUI Programme</h4>
|
||
|
<p>wireshark -> Netzwerkpakete mitschneiden und analysieren
|
||
|
<p>zenmap -> nmap GUI
|
||
|
<p>etherape -> Netzwerkumgebung untersuchen
|
||
|
<pre><code class="bash">~$ sudo apt install etherape</code></pre>
|
||
|
<aside class="notes">etherape installieren lassen</aside>
|
||
|
</section>
|
||
|
|
||
|
<section>Eine Liste von Netzwerk Monitoring Programmen:
|
||
|
<a href="https://wiki.ubuntuusers.de/Netzwerk-Monitoring/">https://wiki.ubuntuusers.de/Netzwerk-Monitoring/</a></section>
|
||
|
|
||
|
<section>
|
||
|
<p>cURL / wget</p>
|
||
|
<pre><code class="bash">
|
||
|
# Datei runterladen
|
||
|
~$ wget http://gute-datei.wow
|
||
|
~$ curl http://{one,two}.example.com -o "file_#1.txt"
|
||
|
</code></pre>
|
||
|
<pre><code class="bash">~$ # pipe curl to bash
|
||
|
~$ curl https://www.schubertdaniel.de/linuxkurs/supi | bash </code></pre>
|
||
|
<div class="fragment">BAD IDEA !!</div>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>Komplette Webseite herunterladen
|
||
|
<pre><code class="bash">~$ wget \
|
||
|
--recursive \
|
||
|
--no-clobber \
|
||
|
--page-requisites \
|
||
|
--html-extension \
|
||
|
--convert-links \
|
||
|
--domains website.org \
|
||
|
--no-parent \
|
||
|
omikron.net</code></pre>
|
||
|
<div class="fragment">Gegenüberstellung <a href="https://daniel.haxx.se/docs/curl-vs-wget.html">cUrl vs. wget </a> </div>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
<p>lynx
|
||
|
<div>
|
||
|
<img src="img/screenshot-lynx.png">
|
||
|
</div>
|
||
|
</section>
|
||
|
<section>
|
||
|
<ul>
|
||
|
<li class="fragment ">samba</li>
|
||
|
<li class="fragment ">mysql</li>
|
||
|
<li class="fragment ">apache</li>
|
||
|
<li class="fragment ">kernelmodule</li>
|
||
|
<li class="fragment ">kernel kompilieren</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
|
||
|
<section>
|
||
|
Übungen
|
||
|
C 11.11 [3] Besorgen Sie sich eine geeignete Datei (etwa ein größeres tar -Ar-
|
||
|
chiv mit Quellcode, vielleicht für den Linux-Kernel) und komprimieren Sie
|
||
|
sie jeweils mit gzip , bzip2 und xz . Messen Sie dabei die Ausführungszeit
|
||
|
durch ein vorgesetztes time . Wie verhalten die Laufzeiten und die Kompri-
|
||
|
mierungsraten sich zueinander?
|
||
|
C 11.12 [2] Experimentieren Sie mit der Datei aus der vorigen Aufgabe und
|
||
|
vergleichen Sie die Laufzeit und die Größe des Resultats für xz mit verschie-
|
||
|
denen Effizienz-Optionen. Was ist der Unterschied zwischen -1 und -6 und
|
||
|
zwischen -6 und -9 ?
|
||
|
</section>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script src="lib/js/head.min.js"></script>
|
||
|
<script src="js/reveal.js"></script>
|
||
|
|
||
|
<script>
|
||
|
|
||
|
// More info https://github.com/hakimel/reveal.js#configuration
|
||
|
Reveal.initialize({
|
||
|
controls: true,
|
||
|
progress: true,
|
||
|
history: true,
|
||
|
center: true,
|
||
|
|
||
|
transition: 'slide', // none/fade/slide/convex/concave/zoom
|
||
|
|
||
|
// More info https://github.com/hakimel/reveal.js#dependencies
|
||
|
dependencies: [
|
||
|
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
||
|
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||
|
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||
|
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
|
||
|
{ src: 'plugin/search/search.js', async: true },
|
||
|
{ src: 'plugin/zoom-js/zoom.js', async: true },
|
||
|
{ src: 'plugin/notes/notes.js', async: true }
|
||
|
]
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|