{"id":792,"date":"2023-12-19T10:01:52","date_gmt":"2023-12-19T10:01:52","guid":{"rendered":"http:\/\/192.168.50.210\/wordpress\/?p=792"},"modified":"2025-06-26T09:24:40","modified_gmt":"2025-06-26T07:24:40","slug":"rpi-nas-extras-encrypting-samba","status":"publish","type":"post","link":"https:\/\/mpr-projects.com\/index.php\/2023\/12\/19\/rpi-nas-extras-encrypting-samba\/","title":{"rendered":"RPi NAS: Extras &#8211; Encrypting Samba"},"content":{"rendered":"\n<p>By default the data that&#8217;s sent to and from a Samba share is not encrypted. In this post we&#8217;ll enable encryption by changing a few settings in Samba&#8217;s configuration file.<\/p>\n\n\n<p>This post is part of a series about building a Network-Attached Storage (NAS) with redundancy using a Raspberry Pi (RPi). See <a href=\"https:\/\/mpr-projects.com\/index.php\/2023\/11\/13\/building-a-raspberry-pi-nas-with-data-redundancy-part-1-overview\/#RPi_NAS_Post_List\" data-type=\"post\" data-id=\"8\">here<\/a> for a list of all posts in this series.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<p>Encryption seems important. If the traffic to and from a Samba share is not encrypted, why do we only talk about encryption now, in some <em>Extras<\/em> post?<\/p>\n\n\n\n<p>The answer is that for most (home) users enabling encryption in Samba does not add that much security. To the best of my knowledge pretty much all WiFi routers in use today encrypt traffic with WPA2 (or even WPA3) by default<sup data-fn=\"e7e33060-247b-45b4-b25f-70052efacbc2\" class=\"fn\"><a href=\"#e7e33060-247b-45b4-b25f-70052efacbc2\" id=\"e7e33060-247b-45b4-b25f-70052efacbc2-link\">1<\/a><\/sup>. Unless you shared your WiFi password with your neighbour they won&#8217;t be able to decrypt the packages sent on your WiFi<sup data-fn=\"214f647c-13c9-4419-8369-36dc36a85ad4\" class=\"fn\"><a href=\"#214f647c-13c9-4419-8369-36dc36a85ad4\" id=\"214f647c-13c9-4419-8369-36dc36a85ad4-link\">2<\/a><\/sup> and so they can&#8217;t read your Samba traffic. Your Ethernet traffic is normally not encrypted but typically it&#8217;s quite difficult for somebody to gain access to an Ethernet port in your home. <\/p>\n\n\n\n<p>That leaves other users on your network. If somebody on your network has a network sniffer like <a href=\"https:\/\/wireshark.org\" target=\"_blank\" rel=\"noreferrer noopener\">Wireshark<\/a> then they will be able to read the data you send to and from the NAS<sup data-fn=\"d280681e-566e-4ab7-9f17-b425ffacb62a\" class=\"fn\"><a href=\"#d280681e-566e-4ab7-9f17-b425ffacb62a\" id=\"d280681e-566e-4ab7-9f17-b425ffacb62a-link\">3<\/a><\/sup>. In my home network I&#8217;m not really worried about that because there are no tech savvy users and I&#8217;ve given them access to my shares anyway. However, that might be different in other locations. Also, an additional layer of security is certainly useful. So let&#8217;s have a look at encryption.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check For Encryption<\/h3>\n\n\n\n<p>First let&#8217;s find out if encryption is used in our current setup. I think the easiest way is to connect to our RPi<sup data-fn=\"cca94205-1cec-4136-910e-09d8359a22fa\" class=\"fn\"><a href=\"#cca94205-1cec-4136-910e-09d8359a22fa\" id=\"cca94205-1cec-4136-910e-09d8359a22fa-link\">4<\/a><\/sup> and run <em>sudo smbstatus<\/em>. This will give an output similar to the one below.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f565742&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f565742\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"218\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-1024x218.png\" alt=\"\" class=\"wp-image-803\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-1024x218.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-300x64.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-768x164.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-1536x328.png 1536w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_1-2048x437.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>That output tells us that we&#8217;re using SMB version 3.1.1. but that the share <em>Scratch<\/em> is not encrypted (there&#8217;s a dash &#8216;-&#8216; underneath encryption).<\/p>\n\n\n\n<p>Alternatively, we can also use Wireshark<sup data-fn=\"f30cbc10-9745-49a9-a76a-da5dcf93d421\" class=\"fn\"><a href=\"#f30cbc10-9745-49a9-a76a-da5dcf93d421\" id=\"f30cbc10-9745-49a9-a76a-da5dcf93d421-link\">5<\/a><\/sup> (that takes a bit more effort but I find it very satisfying). After you open the program select your network interface, in my case that&#8217;s <em>wlan0<\/em>.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f565ced&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f565ced\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-1024x624.png\" alt=\"\" class=\"wp-image-795\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-1024x624.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-300x183.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-768x468.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-1536x935.png 1536w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_2-2048x1247.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>Wireshark will capture all sorts of packets. We only want to monitor those that use the Samba protocol and that go to our NAS, so we can filter as shown below (replace the IP address with the one of your RPi).<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f566156&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f566156\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"255\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_3-1024x255.png\" alt=\"\" class=\"wp-image-796\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_3-1024x255.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_3-300x75.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_3-768x191.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_3.png 1438w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>To test if the connection is encrypted we can, for example, read some file on a mounted share with <code>cat \/path\/to\/share\/somefile<\/code>. Then we look at the packets in Wireshark and try to find the contents of <em>somefile<\/em>.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f56656f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f56656f\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"650\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_4-1024x650.png\" alt=\"\" class=\"wp-image-797\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_4-1024x650.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_4-300x190.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_4-768x488.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Adding_Users_4.png 1446w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>If you look at the bottom right of the screenshot you&#8217;ll see &#8220;<em>this is a secret message<\/em>&#8221; in plain text. That corresponds exactly to the contents of <em>somefile<\/em> so the Samba connection is not encrypted.<\/p>\n\n\n\n<p>You may be wondering why we can read the packets even though we&#8217;re using encrypted WiFi. That&#8217;s because by the time Wireshark gets the packets they have already been decrypted by our computer. So WiFi encryption won&#8217;t show up when we use Wireshark in this way<sup data-fn=\"cd70a86a-7753-4595-a549-228d731eef20\" class=\"fn\"><a href=\"#cd70a86a-7753-4595-a549-228d731eef20\" id=\"cd70a86a-7753-4595-a549-228d731eef20-link\">6<\/a><\/sup>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling Encryption<\/h3>\n\n\n\n<p>To enable encryption, connect to your Raspberry Pi and open the Samba configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/samba\/smb.conf<\/code><\/pre>\n\n\n\n<p>In that file, under <em>[global]<\/em>, add the following line.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f566b55&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f566b55\" class=\"wp-block-image aligncenter size-medium wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"45\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2024\/01\/Samba_Encryption_5_cropped-300x45.jpg\" alt=\"\" class=\"wp-image-1265\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2024\/01\/Samba_Encryption_5_cropped-300x45.jpg 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2024\/01\/Samba_Encryption_5_cropped-768x115.jpg 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2024\/01\/Samba_Encryption_5_cropped.jpg 889w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>This line forces the connection to be encrypted. If a client is not capable of encryption then it won&#8217;t be able to connect to the NAS (to my knowledge all modern computers should be able to use encryption). <\/p>\n\n\n\n<p>FYI, if you look at the man pages of <em>smb.conf <\/em><sup data-fn=\"01c18fbf-e8fb-4921-a329-d9cbba2840fa\" class=\"fn\"><a href=\"#01c18fbf-e8fb-4921-a329-d9cbba2840fa\" id=\"01c18fbf-e8fb-4921-a329-d9cbba2840fa-link\">7<\/a><\/sup> then you&#8217;ll find that the effect of this option depends on the Samba version that&#8217;s being used. Version 1 didn&#8217;t have any native Samba encryption. Instead it used Unix extensions (which we have to disable due to the way Greyhole is implemented). However, version 1 has been deprecated and only clients that support at least version 2, which supports native encryption, can connect (see option <em>min protocol<\/em>).<\/p>\n\n\n\n<p>So after we close the file we restart the Samba daemon.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart smbd<\/code><\/pre>\n\n\n\n<p>If we run <em>sudo smbstatus<\/em> again we&#8217;ll see that the connection is now encrypted,<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f5670a9&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f5670a9\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"225\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-1024x225.png\" alt=\"\" class=\"wp-image-799\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-1024x225.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-300x66.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-768x169.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-1536x337.png 1536w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_6-2048x450.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>and the packets captured by Wireshark are unreadable.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e798f5674db&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e798f5674db\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"996\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_7-1024x996.png\" alt=\"\" class=\"wp-image-800\" srcset=\"https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_7-1024x996.png 1024w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_7-300x292.png 300w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_7-768x747.png 768w, https:\/\/mpr-projects.com\/wp-content\/uploads\/2023\/12\/Samba_Encryption_7.png 1528w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>So that&#8217;s it. We&#8217;ve now got an extra layer of security for our Samba connections.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<p>Footnotes:<\/p>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"e7e33060-247b-45b4-b25f-70052efacbc2\">At least that&#8217;s what I see when I look at the WiFi networks around me. <a href=\"#e7e33060-247b-45b4-b25f-70052efacbc2-link\" aria-label=\"Jump to footnote reference 1\">\u21a9\ufe0e<\/a><\/li><li id=\"214f647c-13c9-4419-8369-36dc36a85ad4\">The chances of somebody breaking WPA2 encryption are rather slim. <a href=\"#214f647c-13c9-4419-8369-36dc36a85ad4-link\" aria-label=\"Jump to footnote reference 2\">\u21a9\ufe0e<\/a><\/li><li id=\"d280681e-566e-4ab7-9f17-b425ffacb62a\">Maybe more importantly, if they are in the same household as you then they probably have physical access to the NAS. Since we haven&#8217;t encrypted the drives anybody could just take them, mount them on their computer and read all the data. <a href=\"#d280681e-566e-4ab7-9f17-b425ffacb62a-link\" aria-label=\"Jump to footnote reference 3\">\u21a9\ufe0e<\/a><\/li><li id=\"cca94205-1cec-4136-910e-09d8359a22fa\">With SSH or directly connecting the RPi to a screen, either way will be fine. <a href=\"#cca94205-1cec-4136-910e-09d8359a22fa-link\" aria-label=\"Jump to footnote reference 4\">\u21a9\ufe0e<\/a><\/li><li id=\"f30cbc10-9745-49a9-a76a-da5dcf93d421\">There are quite a few websites showing you how to install and set up Wireshark. If you don&#8217;t see a network adapter then you may have to add your user to the <em>network<\/em> group with <em>sudo usermod -a -G network username<\/em>. <a href=\"#f30cbc10-9745-49a9-a76a-da5dcf93d421-link\" aria-label=\"Jump to footnote reference 5\">\u21a9\ufe0e<\/a><\/li><li id=\"cd70a86a-7753-4595-a549-228d731eef20\">We&#8217;re only monitoring the traffic of our own computer here. You can also use Wireshark to monitor traffic that&#8217;s not addressed to our computer. If you know the WiFi password of the connection you&#8217;re monitoring then you can decrypt those packages, otherwise they will all be encrypted. <a href=\"#cd70a86a-7753-4595-a549-228d731eef20-link\" aria-label=\"Jump to footnote reference 6\">\u21a9\ufe0e<\/a><\/li><li id=\"01c18fbf-e8fb-4921-a329-d9cbba2840fa\">You can open them from the terminal with <code>man smb.conf<\/code>. <a href=\"#01c18fbf-e8fb-4921-a329-d9cbba2840fa-link\" aria-label=\"Jump to footnote reference 7\">\u21a9\ufe0e<\/a><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>By default the data that&#8217;s sent to and from a Samba share is not encrypted. In this post we&#8217;ll enable encryption by changing a few settings in Samba&#8217;s configuration file. Encryption seems important. If the traffic to and from a Samba share is not encrypted, why do we only talk about encryption now, in some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-single-with-sidebar-1","format":"standard","meta":{"_eb_attr":"","footnotes":"[{\"content\":\"At least that's what I see when I look at the WiFi networks around me.\",\"id\":\"e7e33060-247b-45b4-b25f-70052efacbc2\"},{\"content\":\"The chances of somebody breaking WPA2 encryption are rather slim.\",\"id\":\"214f647c-13c9-4419-8369-36dc36a85ad4\"},{\"content\":\"Maybe more importantly, if they are in the same household as you then they probably have physical access to the NAS. Since we haven't encrypted the drives anybody could just take them, mount them on their computer and read all the data.\",\"id\":\"d280681e-566e-4ab7-9f17-b425ffacb62a\"},{\"content\":\"With SSH or directly connecting the RPi to a screen, either way will be fine.\",\"id\":\"cca94205-1cec-4136-910e-09d8359a22fa\"},{\"content\":\"There are quite a few websites showing you how to install and set up Wireshark. If you don't see a network adapter then you may have to add your user to the <em>network<\/em> group with <em>sudo usermod -a -G network username<\/em>.\",\"id\":\"f30cbc10-9745-49a9-a76a-da5dcf93d421\"},{\"content\":\"We're only monitoring the traffic of our own computer here. You can also use Wireshark to monitor traffic that's not addressed to our computer. If you know the WiFi password of the connection you're monitoring then you can decrypt those packages, otherwise they will all be encrypted.\",\"id\":\"cd70a86a-7753-4595-a549-228d731eef20\"},{\"content\":\"You can open them from the terminal with <code>man smb.conf<\/code>.\",\"id\":\"01c18fbf-e8fb-4921-a329-d9cbba2840fa\"}]"},"categories":[3,10],"tags":[9,7,4,5],"class_list":["post-792","post","type-post","status-publish","format-standard","hentry","category-linux","category-projects","tag-data-safety","tag-greyhole","tag-linux","tag-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/comments?post=792"}],"version-history":[{"count":16,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/792\/revisions"}],"predecessor-version":[{"id":2238,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/792\/revisions\/2238"}],"wp:attachment":[{"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/media?parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/categories?post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mpr-projects.com\/index.php\/wp-json\/wp\/v2\/tags?post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}