{"id":953,"date":"2026-07-09T09:30:50","date_gmt":"2026-07-09T07:30:50","guid":{"rendered":"https:\/\/nightworker.ddnss.de\/?page_id=953"},"modified":"2026-07-09T09:44:31","modified_gmt":"2026-07-09T07:44:31","slug":"sichere-fstab","status":"publish","type":"page","link":"https:\/\/nightworker.ddnss.de\/index.php\/sichere-fstab\/","title":{"rendered":"Sichere fstab"},"content":{"rendered":"<h2 class=\"el-h3\">Ein kleiner Tipp um die fstab sicherer zu machen:<\/h2>\n<div class=\"el-p\">\n<div class=\"el-p\">\n<p dir=\"auto\">Falls du dein Passwort f\u00fcr das Netzlaufwerk direkt in der&nbsp;<code class=\"code-styler-inline\">\/etc\/fstab<\/code>&nbsp;stehen hast, ist das ein Sicherheitsrisiko (da jeder Nutzer die Datei lesen kann). Falls du es noch nicht so gel\u00f6st hast, empfehle ich eine&nbsp;<strong>Credentials-Datei<\/strong>:<\/p>\n<p dir=\"auto\">&nbsp;<\/p>\n<ol>\n<li><strong>Erstelle zuerst die Anmeldedatei in Ihrem eigenen Heimverzeichnis.<\/strong> Ersetze Sie dabei <code class=\"KDcb0c\" dir=\"ltr\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-sae=\"\" data-copy-service-computed-style=\"font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);\">&lt;DEIN_BENUTZERNAME&gt;<\/code> durch deinen echten Linux-Benutzernamen.<br \/>\nDer Befehl <strong><code class=\"code-styler-inline\">chmod 600<\/code><\/strong>&nbsp;ist ein Sicherheitsmechanismus, mit dem du festlegst, wer eine Datei lesen oder bearbeiten darf. Er ist besonders wichtig f\u00fcr Dateien, die sensible Informationen wie Passw\u00f6rter (z. B. deine&nbsp;<code class=\"code-styler-inline\">.smbserver<\/code>-Datei) enthalten.<\/li>\n<\/ol>\n<\/div>\n<div class=\"el-ul\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">touch&nbsp;\/home\/&lt;DEIN_BENUTZERNAME&gt;\/.smbserver\r\nchmod&nbsp;600&nbsp;\/home\/&lt;DEIN_BENUTZERNAME&gt;\/.smbserver<\/pre>\n<p style=\"padding-left: 40px;\">(Trage in diese Datei deine Zugangsdaten im Format <code class=\"KDcb0c\" dir=\"ltr\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-copy-service-computed-style=\"font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);\">username=...<!--TgQPHd||[]--><\/code> und <code class=\"KDcb0c\" dir=\"ltr\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-copy-service-computed-style=\"font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);\">password=...<!--TgQPHd||[]--><\/code> ein).<\/p>\n<ol start=\"2\">\n<li><strong>Eintrag in der \/etc\/fstab:<br \/>\n<\/strong>F\u00fcge die folgende Zeile in die Datei <code class=\"KDcb0c\" dir=\"ltr\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-sae=\"\" data-copy-service-computed-style=\"font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);\">\/etc\/fstab<\/code> ein. <strong class=\"Yjhzub\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-copy-service-computed-style=\"font-family: &quot;Google Sans&quot;, Arial, sans-serif; font-size: 16px; font-weight: 700; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);\">Achtung:<\/strong> Verwende hier <em class=\"eujQNb\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-copy-service-computed-style=\"font-family: &quot;Google Sans&quot;, Arial, sans-serif; font-size: 16px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 0px rgb(10, 10, 10);\">niemals<\/em> das K\u00fcrzel <code class=\"KDcb0c\" dir=\"ltr\" data-sfc-root=\"ep\" data-sfc-cb=\"\" data-complete=\"true\" data-sae=\"\" data-copy-service-computed-style=\"font-family: monospace; font-size: 14px; font-weight: 400; margin: 0px; text-decoration: none; border-bottom: 1px solid rgb(240, 242, 245);\">~<\/code>, sondern immer den echten, vollen Pfad zu deinem Benutzerordner:<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\/\/IP-ADRESSE\/ORDNER&nbsp;\/mount\/pfad&nbsp;cifs&nbsp;credentials=\/home\/&lt;DEIN_BENUTZERNAME&gt;\/.smbserver,iocharset=utf8,nobrl&nbsp;0&nbsp;0&lt;br&nbsp;\/&gt;<\/pre>\n<p style=\"padding-left: 40px;\">\/\/IP-ADRESSE\/ORDNER = die Freigabe in deinem Netzwerk<br \/>\n\/mount\/pfad\/ = der Ort, in den die Freigabe geladen wird<\/p>\n<\/div>\n<\/div>\n<div class=\"el-hr\">\n<hr>\n<\/div>\n<div class=\"el-h2\">\n<h2 dir=\"auto\" data-heading=\"1\\. Was bedeuten die Zahlen?\">Chmod, was bedeuten die Zahlen?<\/h2>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">In der Linux-Welt werden Dateirechte oft dreistellig vergeben. Jede Ziffer steht f\u00fcr eine Benutzergruppe:<\/p>\n<\/div>\n<div class=\"el-ol\">\n<ol>\n<li dir=\"auto\" data-line=\"0\"><strong>Ziffer (6):<\/strong>&nbsp;Der&nbsp;<strong>Besitzer<\/strong>&nbsp;der Datei (du).<\/li>\n<li dir=\"auto\" data-line=\"2\"><strong>Ziffer (0):<\/strong>&nbsp;Die&nbsp;<strong>Gruppe<\/strong>&nbsp;(andere Nutzer in deiner Benutzergruppe).<\/li>\n<li dir=\"auto\" data-line=\"4\"><strong>Ziffer (0):<\/strong>&nbsp;Der&nbsp;<strong>Rest der Welt<\/strong>&nbsp;(alle anderen Nutzer auf dem System).<\/li>\n<\/ol>\n<\/div>\n<div class=\"el-h3\">\n<h3 dir=\"auto\" data-heading=\"Die Bedeutung der &quot;6&quot; und &quot;0&quot;:\">Die Bedeutung der &#8220;6&#8221; und &#8220;0&#8221;:<\/h3>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Die Zahlen setzen sich aus Werten zusammen:<\/p>\n<\/div>\n<div class=\"el-ul\">\n<ul class=\"has-list-bullet\">\n<li dir=\"auto\" data-line=\"0\"><strong>4<\/strong>&nbsp;= Lesen (<code class=\"code-styler-inline\">r<\/code>ead)<\/li>\n<li dir=\"auto\" data-line=\"2\"><strong>2<\/strong>&nbsp;= Schreiben (<code class=\"code-styler-inline\">w<\/code>rite)<\/li>\n<li dir=\"auto\" data-line=\"4\"><strong>1<\/strong>&nbsp;= Ausf\u00fchren (<code class=\"code-styler-inline\">x<\/code>ecute)<\/li>\n<li dir=\"auto\" data-line=\"6\"><strong>0<\/strong>&nbsp;= Keinerlei Rechte<\/li>\n<\/ul>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Eine&nbsp;<strong>6<\/strong>&nbsp;(4+2) bedeutet also:&nbsp;<strong>Lesen und Schreiben erlaubt.<\/strong>&nbsp;Eine&nbsp;<strong>0<\/strong>&nbsp;bedeutet:&nbsp;<strong>Kein Zugriff.<\/strong><\/p>\n<\/div>\n<div class=\"el-hr\">\n<hr>\n<\/div>\n<div class=\"el-h2\">\n<h2 dir=\"auto\" data-heading=\"2\\. Das Ergebnis von `chmod 600`\">Das Ergebnis von <code class=\"code-styler-inline\">chmod 600<\/code><\/h2>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Wenn du&nbsp;<code class=\"code-styler-inline\">chmod 600 dateiname<\/code>&nbsp;ausf\u00fchrst, bewirkt das Folgendes:<\/p>\n<\/div>\n<div class=\"el-ul\">\n<ul class=\"has-list-bullet\">\n<li dir=\"auto\" data-line=\"0\"><strong>Besitzer (Du):<\/strong>&nbsp;Du kannst die Datei&nbsp;<strong>lesen<\/strong>&nbsp;und&nbsp;<strong>\u00e4ndern<\/strong>.<\/li>\n<li dir=\"auto\" data-line=\"2\"><strong>Gruppe:<\/strong>&nbsp;Niemand sonst aus deiner Gruppe kann die Datei sehen oder \u00f6ffnen.<\/li>\n<li dir=\"auto\" data-line=\"4\"><strong>Andere:<\/strong>&nbsp;Jeder andere Nutzer auf dem PC wird blockiert.<\/li>\n<\/ul>\n<\/div>\n<div class=\"el-h2\">\n<h2 dir=\"auto\" data-heading=\"3\\. Warum ist das f\u00fcr deine Netzlaufwerke wichtig?\">Warum ist das f\u00fcr deine Netzlaufwerke wichtig?<\/h2>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Die Datei&nbsp;<code class=\"code-styler-inline\">\/etc\/fstab<\/code>&nbsp;ist f\u00fcr jeden Nutzer auf deinem System lesbar. Wenn du dort dein Passwort im Klartext eintr\u00e4gst, k\u00f6nnte jeder andere Nutzer (oder ein b\u00f6sartiges Skript) dein Passwort einfach auslesen.<\/p>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Indem du die Zugangsdaten in eine separate Datei (z. B.&nbsp;<code class=\"code-styler-inline\">.smbserver<\/code>) auslagerst und diese mit&nbsp;<code class=\"code-styler-inline\">chmod 600<\/code>&nbsp;sch\u00fctzt, stellst du sicher, dass:<\/p>\n<\/div>\n<div class=\"el-ol\">\n<ol>\n<li dir=\"auto\" data-line=\"0\">Das System (Root) beim Booten die Datei lesen kann, um das Netzlaufwerk einzubinden.<\/li>\n<li dir=\"auto\" data-line=\"2\"><strong>Nur du<\/strong>&nbsp;pers\u00f6nlich die Datei \u00f6ffnen kannst.<\/li>\n<li dir=\"auto\" data-line=\"4\">Kein anderer lokaler Nutzer dein Passwort erf\u00e4hrt.<\/li>\n<\/ol>\n<\/div>\n<div class=\"el-hr\">\n<hr>\n<\/div>\n<div class=\"el-h3\">\n<h3 dir=\"auto\" data-heading=\"Kleiner Test\">Kleiner Test<\/h3>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Du kannst das Ergebnis selbst \u00fcberpr\u00fcfen. Gib im Terminal einfach folgendes ein:<\/p>\n<pre class=\"EnlighterJSRAW\" dir=\"auto\" data-enlighter-language=\"bash\">ls&nbsp;-l&nbsp;.smbserver<\/pre>\n<\/div>\n<div class=\"el-p\">&nbsp;<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Du wirst am Anfang der Zeile etwas sehen wie:&nbsp;<code class=\"code-styler-inline\">-rw-------<\/code>.<\/p>\n<\/div>\n<div class=\"el-ul\">\n<ul class=\"has-list-bullet\">\n<li dir=\"auto\" data-line=\"0\"><code class=\"code-styler-inline\">rw-<\/code>&nbsp;steht f\u00fcr dich (Read\/Write).<\/li>\n<li dir=\"auto\" data-line=\"2\"><code class=\"code-styler-inline\">------<\/code>&nbsp;zeigt, dass f\u00fcr alle anderen alle Striche (kein Zugriff) gesetzt sind.<\/li>\n<\/ul>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">&nbsp;<\/p>\n<\/div>\n<div class=\"el-p\">\n<p dir=\"auto\">Hier ist der direkte Vergleich, was die neuen Parameter bewirken:<\/p>\n<\/div>\n<div class=\"el-hr\">\n<hr>\n<\/div>\n<div class=\"el-h3\">\n<h3 dir=\"auto\" data-heading=\"Die Unterschiede im Detail\">Die Unterschiede im Detail<\/h3>\n<\/div>\n<div class=\"el-table\" dir=\"ltr\">\n<table>\n<thead>\n<tr>\n<th dir=\"ltr\"><strong>Parameter<\/strong><\/th>\n<th dir=\"ltr\"><strong>Dein aktueller Eintrag<\/strong><\/th>\n<th dir=\"ltr\"><strong>Neuer Vorschlag<\/strong><\/th>\n<th dir=\"ltr\"><strong>Was es bewirkt<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td dir=\"ltr\"><strong>nobrl<\/strong><\/td>\n<td dir=\"ltr\">Nicht vorhanden<\/td>\n<td dir=\"ltr\"><strong>Aktiviert<\/strong><\/td>\n<td dir=\"ltr\"><strong>Das Wichtigste f\u00fcr dich:<\/strong> Es deaktiviert das &#8220;Byte-Range Locking&#8221;. Gocryptfs und viele Editoren scheitern an den Sperrmechanismen von Netzwerkprotokollen. Ohne <code class=\"code-styler-inline\">nobrl<\/code> kommt es zu deinem beschriebenen Speicherfehler.<\/td>\n<\/tr>\n<tr>\n<td dir=\"ltr\"><strong>iocharset=utf8<\/strong><\/td>\n<td dir=\"ltr\">Standard (oft ASCII)<\/td>\n<td dir=\"ltr\"><strong>Erzwungen<\/strong><\/td>\n<td dir=\"ltr\">Stellt sicher, dass Umlaute (\u00e4, \u00f6, \u00fc) und Sonderzeichen in Dateinamen korrekt zwischen Linux und dem Netzlaufwerk \u00fcbersetzt werden. Ohne dies k\u00f6nnten Dateien &#8220;verschwinden&#8221; oder falsch benannt werden.<\/td>\n<\/tr>\n<tr>\n<td dir=\"ltr\"><strong>credentials<\/strong><\/td>\n<td dir=\"ltr\"><code class=\"code-styler-inline\">username=...<\/code><\/td>\n<td dir=\"ltr\"><code class=\"code-styler-inline\">credentials=\/path<\/code><\/td>\n<td dir=\"ltr\"><strong>Sicherheit:<\/strong> Anstatt dein Passwort im Klartext in die <code class=\"code-styler-inline\">fstab<\/code> zu schreiben (die jeder lesen kann), verweist du auf die gesch\u00fctzte Datei (<code class=\"code-styler-inline\">chmod 600<\/code>), die wir erstellt haben.<\/td>\n<\/tr>\n<tr>\n<td dir=\"ltr\"><strong>defaults<\/strong><\/td>\n<td dir=\"ltr\">Aktiviert<\/td>\n<td dir=\"ltr\">Meist redundant<\/td>\n<td dir=\"ltr\"><code class=\"code-styler-inline\">defaults<\/code> setzt Standardwerte wie <code class=\"code-styler-inline\">rw<\/code>, <code class=\"code-styler-inline\">suid<\/code>, <code class=\"code-styler-inline\">dev<\/code>, <code class=\"code-styler-inline\">exec<\/code>, <code class=\"code-styler-inline\">auto<\/code>, <code class=\"code-styler-inline\">nouser<\/code>, und <code class=\"code-styler-inline\">async<\/code>. In Kombination mit spezifischen Werten kann man es weglassen.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ein kleiner Tipp um die fstab sicherer zu machen: Falls du dein Passwort f\u00fcr das Netzlaufwerk direkt in der&nbsp;\/etc\/fstab&nbsp;stehen hast,<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-953","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/pages\/953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/comments?post=953"}],"version-history":[{"count":15,"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/pages\/953\/revisions"}],"predecessor-version":[{"id":969,"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/pages\/953\/revisions\/969"}],"wp:attachment":[{"href":"https:\/\/nightworker.ddnss.de\/index.php\/wp-json\/wp\/v2\/media?parent=953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}