linuxkurs/13.html

230 lines
8.9 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 13
<p> <small>Deutsche Angestellten Akademie</small> </p>
<aside class="notes">
Frage: Fragen zur letzten Stunde?
</aside>
</section>
<section data-transition="slide" data-background="#b5533c" data-background-transition="convex">
<h3>Samba</h3>
<h4>Filesharing / Netzwerk-Freigaben</h4>
</section>
<section>
Samba ist ein Datei-, Druck- und auch Domänen-Anmelde-Server unter Linux für die Anbindung von Windows- und OSX-Clients. Samba steht unter der GPL, ist also frei verfügbar.<br> Es gibt keine strikte Trennung zw. Client u. Server. Jeder beteiligte Host kann beides sein.
</section>
<section>
<h4>Nutzung zum Hausgebrauch</h4>
<pre><code class="bash"># Nutzung von samba mit Nautilus möglich per
~$ sudo apt install samba nautilus-share
~$ sudo usermod -aG sambashare BENUTZERNAME
</code></pre>
<ul>
<li >Dann ab- und wieder an-melden</li>
<li >prüfen ob Nutzer in Gruppe „sambashare”</li>
<li >nun Freigaben in Nautilus per Rechtsklick möglich</li>
<li >Freigaben sind auch für Windoes und OSX sichtbar</li>
<li class="fragment highlight-red">und für ALLE ANDEREN !!</li>
</ul>
</section>
<section>
<h5>Natürlich auch im Terminal ;-)</h5>
<ul><li><p>Freigaben erstellen oder verändern: </p><div class="bash"><div class="contents"><pre class="bash">~$ net usershare add SHARENAME PFAD [comment [acl] [guest_ok=[y|n]]] </pre></div></div></li><li><p>Freigaben aufheben: </p><div class="bash"><div class="contents"><pre class="bash">~$ net usershare delete SHARENAME </pre></div></div></li><li><p>Vorhandene Freigaben auflisten: </p><div class="bash"><div class="contents"><pre class="bash">~$ net usershare list [-l|--long] [SHARENAME] </pre></div></div></li><li><p>Informationen über eine oder mehrere Freigaben ausgeben: </p><div class="bash"><div class="contents"><pre class="bash">~$ net usershare info [-l|--long] [SHARENAME] </pre></div></div></li></ul>
</section>
<section>
<h5>Beispiel</h5>
<pre style="font-size: .5em"><code class="bash">~$ net usershare add Urlaubsbilder /home/otto/Bilder/Urlaub \
Urlaubsbilder-2012 Everyone:R,otto:F guest_ok=y </code></pre>
<pre><code class="bash">~$ net usershare info *bilder </code></pre>
<pre><code class="bash">~$ cat /var/lib/samba/usershares/Urlaubsbilder</code></pre>
<a style="font-size: .5em" href="https://wiki.ubuntuusers.de/Samba_Server/net_usershare/">https://wiki.ubuntuusers.de/Samba_Server/net_usershare/</a>
</section>
<section>
<span style="color: orange">Aufgabe:</span>
<ul>
<li>Erstellt eine Samba-Netzwerkfreigabe in Nautilus</li>
<li>sucht die Freigaben der anderen Teilnehmer</li>
</ul>
<p>Hinweise:
<pre><code class="bash"># Nutzung von samba mit Nautilus möglich per
~$ sudo apt install samba nautilus-share
~$ sudo usermod -aG sambashare BENUTZERNAME
</code></pre>
<ul>
<li >Dann ab- und wieder an-melden</li>
<li >prüfen ob Nutzer in Gruppe „sambashare”</li>
<li>Happy Filesharing!</li>
</ul>
</section>
<section>
<h4>Nutzung im grösseren Rahmen</h4>
<ul>
<li class="fragment "><code>/etc/samba/smb.conf</code></li>
<li class="fragment ">Nutzerrechte konfigurierbar</li>
<li class="fragment ">User müssen zusätzlich zum System innerhalb v. samba angelegt werden</li>
</ul>
<pre class="fragment"><code class="bash">~$ sudo smbpasswd -a USERNAME # Fügt den Benutzer USERNAME der Samba Datenbank hinzu und aktiviert diesen
~$ sudo smbpasswd -x USERNAME # Entfernt den Benutzer USERNAME aus der Samba Datenbank
~$ sudo smbpasswd -d USERNAME # Deaktiviert den Benutzer USERNAME in der Datenbank
~$ sudo smbpasswd -e USERNAME # Aktiviert den vorher deaktivierten Benutzer USERNAME in der Datenbank wieder </code></pre>
</section>
<section>
<p>Möglichkeiten mit Samba:
<ul>
<li class="fragment ">Dateifreigabe</li>
<li class="fragment ">Rechtesteuerung</li>
<li class="fragment ">Druckerfreigabe</li>
<li class="fragment ">kann einen Active Directory Domain Controller ersetzen</li>
<li class="fragment"><a href="https://wiki.ubuntuusers.de/Samba/">https://wiki.ubuntuusers.de/Samba/</a></li>
</ul>
</section>
<section>
<code>/etc/samba/smb.conf</code>
<pre style="font-size: .4em"><code style="max-height:100vh" class="bash">[global]
workgroup = AWESOME
map to guest = Bad User
log file = /var/log/samba/%m
[homes]
# macht alle lokalen home Verzeichnisse zugänglich
comment = Home Directories
browseable = yes
[guest]
# This share allows anonymous (guest) access
# without authentication!
path = /srv/samba/guest/
read only = no
guest ok = yes
[demo]
# This share requires authentication to access
path = /mnt/huge-1TB-sata-drive/moviez/
read only = no
guest ok = no</code></pre>
<pre><code class="bash"># testet die config auf Korrektheit:
~$ testparm </code></pre>
</section>
<section>GUI für samba Server:<br>gadmin-samba</section>
<section style="font-size: .7em">
Wir bauen ein lokales Netzwerk und machen Filesharing
<p><span style="color: orange">Aufgabe:</span>
<ul>
<li>verbindet euch mit dem von mir mitgebrachten switch</li>
<li>konfiguriert eurer ethernet Schnittstelle per <code>/etc/network/interfaces</code> eine IP Adresse im Bereich <strong>192.168.1.10-20</strong><br> ( absprechen !! )</li>
<li>sucht nach der Samba-Freigabe unter der IP 192.168.1.5</li>
<li>mounted die Samba-Freigabe “omikron“ unter <code>~/samba_share</code> :: user=omikron, password=omikron</li>
</ul>
<p>Hinweise:
<ul>
<li>Stichwort „static IP“</li>
<li>
<a href="https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" target="_blank">Statische IP konfigurieren</a>
</li>
<li>
<a href="https://www.debian.org/doc/manuals/debian-reference/ch05.de.html#_safe_low_level_network_operations" target="_blank">Nützliche Befehle</a>
</li>
<li>mounten per /etc/fstab oder per <a href="9.html#/4">Systemd</a></li>
</ul>
<aside class="notes">gateway einstellen: eigene IP</aside>
</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>