{"id":239,"date":"2017-05-20T06:50:22","date_gmt":"2017-05-20T05:50:22","guid":{"rendered":"http:\/\/chewett.co.uk\/?p=239"},"modified":"2017-05-21T23:48:06","modified_gmt":"2017-05-21T22:48:06","slug":"create-samba-share-raspberry-pi-cluster","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/239\/create-samba-share-raspberry-pi-cluster\/","title":{"rendered":"Create a Samba Share on Raspberry Pi Cluster"},"content":{"rendered":"<p>Something I want to do with my Raspberry Pi Cluster is mount a hard drive and share it like a windows share. To do this I am going to set up Samba on a Raspberry Pi.<\/p>\n<h2>Installing the required packages<\/h2>\n<p>To run samba as a service we need to install a couple packages. Running the following command will install what you need.<\/p>\n<pre>sudo apt-get install samba samba-common-bin<\/pre>\n<h2>Configuring Samba<\/h2>\n<p>To modify samba configuration on a Raspberry Pi you can use its config file. This file is located\u00a0\/etc\/samba\/smb.conf once you have installed the appropiate packages.\u00a0To set up samba to be liking I am going to modify and add a couple lines to the base settings.<\/p>\n<p>The workgroup setting defines which workgroup the user you will be logging in as will need. By default\u00a0the setting is WORKGROUP but this can be changed to anything required. Here im going to change the workgroup to &#8220;bunker&#8221;.<\/p>\n<pre>workgroup = BUNKER #customize the workgroup<\/pre>\n<p>To ensure that only logged in users are able to access the shares I have set the security level to &#8220;user&#8221;. This method of security validates against samba\u00a0user accounts and is the most basic level.<\/p>\n<pre>security = user #ensure security level is user only<\/pre>\n<p>The default samba settings will expose the \u00a0logged in users home directory however it will not be writeable. By changing &#8220;read only&#8221; to no this will allow editing the users home directory<\/p>\n<pre>[homes]\r\nread only = no\u00a0 #allow writing of home dir<\/pre>\n<h2>Setting up a share folder<\/h2>\n<p>To finally set up the share folder you need to add in the details of the share. Again this is modifying the samba config file as above. Below is an example share folder configuration and an explanation of some of the settings.<\/p>\n<pre>[BUNKER1]\r\ncomment = Bunker Node1 Share\r\npath = \/usr\/local\/bunker\r\nvalid users = @samba\r\nforce group = samba\r\ncreate mask = 0660\r\ndirectory mask = 0771\r\nread only = no<\/pre>\n<ul>\n<li>[BUNKER1] is the name\u00a0that windows will assign to the folder<\/li>\n<li>comment is used in some programs to describe the share<\/li>\n<li>path is the local path on the Raspberry Pi that the share will be exposing<\/li>\n<li>valid users lists all valid users which can be a single user, or list of usernames. Here I have used &#8220;@samba&#8221; to allow all users of the group &#8220;samba&#8221; to access the share<\/li>\n<li>force group will force the accessing user to read files as that group. This can be used\u00a0to determine what the user can access or do.<\/li>\n<li>create mask is used to apply a bitwise and to the generated permissions. 0660 ensures files are not accessibly by any user, this applies to create files<\/li>\n<li>directory mask works similarly to the above but applies to created directories. Here I am setting it to 0771 to ensure all directories are executable (browsable)<\/li>\n<li>read only sets whether you are only allowed to\u00a0write\/delete the files<\/li>\n<\/ul>\n<h2>Configuring users to access samba<\/h2>\n<p>Once you have set up samba with the above settings you need to add a user to be able to access samba. Since I have set my folder to require the samba group I can add it to my user by running<\/p>\n<pre>sudo groupadd samba\r\nsudo usermod -aG samba chewett\r\nsudo smbpasswd -a chewett<\/pre>\n<p>By default Raspbian has no\u00a0samba group so it needs to be created therefore the first command creates one. The second command then adds the &#8220;samba&#8221; group to the user account &#8220;chewett&#8221;. The third command will set the samba password for the same user account. This will let the user chewett\u00a0access samba.<\/p>\n<p>Now we need to restart samba so that config takes effect.<\/p>\n<pre>sudo \/etc\/init.d\/samba restart<\/pre>\n<h2>Accessing Samba from windows<\/h2>\n<p>Now you should be able to access samba from windows by going to \\\\hostname\\ . Here the hostname is bunker-node1 so I access it by going to \\\\bunker-node1<\/p>\n<figure id=\"attachment_303\" aria-describedby=\"caption-attachment-303\" style=\"width: 648px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"303\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/239\/create-samba-share-raspberry-pi-cluster\/bunker_node1_samba\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?fit=648%2C236&amp;ssl=1\" data-orig-size=\"648,236\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bunker_node1_samba\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?fit=300%2C109&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?fit=648%2C236&amp;ssl=1\" class=\"wp-image-303 size-full\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?resize=648%2C236\" alt=\"\" width=\"648\" height=\"236\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?w=648&amp;ssl=1 648w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?resize=300%2C109&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba.jpg?resize=50%2C18&amp;ssl=1 50w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/a><figcaption id=\"caption-attachment-303\" class=\"wp-caption-text\">Browsing via samba to my raspberry pi host &#8220;bunker-node1&#8221;<\/figcaption><\/figure>\n<p>Once I have entered the hostname and selected a folder will present\u00a0a login prompt asking for a username and password. If your computer is on the same workgroup as the samba config you will just need to enter the username and password. If they are running on different work groups you will need to enter workgroup\\username as the username. In this case I need to enter bunker\\chewett as bunker is the workgroup and chewett is the username.<\/p>\n<figure id=\"attachment_302\" aria-describedby=\"caption-attachment-302\" style=\"width: 849px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"302\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/239\/create-samba-share-raspberry-pi-cluster\/bunker_node1_samba_login\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?fit=849%2C576&amp;ssl=1\" data-orig-size=\"849,576\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bunker_node1_samba_login\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?fit=300%2C204&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?fit=678%2C460&amp;ssl=1\" class=\"wp-image-302 size-full\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?resize=678%2C460\" alt=\"\" width=\"678\" height=\"460\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?w=849&amp;ssl=1 849w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?resize=768%2C521&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/bunker_node1_samba_login.jpg?resize=50%2C34&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/a><figcaption id=\"caption-attachment-302\" class=\"wp-caption-text\">Logging into the samba share with login details bunker\\chewett<\/figcaption><\/figure>\n<p>Now I have access to my raspberry pi files on windows. I can expand this by adding more folders to the samba config I can mount external drives and have them accessible on the windows network.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Something I want to do with my Raspberry Pi Cluster is mount a hard drive and share it like a windows share. To do this I am going to set up Samba on a Raspberry Pi. Installing the required packages To run samba as a service we need to install a couple packages. Running the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[122],"tags":[39,37,115,116],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi-cluster","tag-linux","tag-raspberry-pi","tag-samba","tag-windows-share"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-3R","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":241,"url":"https:\/\/chewett.co.uk\/blog\/241\/installing-raspbian-onto-raspberry-pi\/","url_meta":{"origin":239,"position":0},"title":"Installing Raspbian onto a Raspberry Pi","author":"Chewett","date":"May 17, 2017","format":false,"excerpt":"Here I suggest some recommended steps to install Raspbian on top of their install guide. Choosing an OS for the Raspberry Pi One of the main ways to install a Raspberry Pi OS is to download a disk image called NOOBS.\u00a0This lets you\u00a0choose to easily install a number of different\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2739,"url":"https:\/\/chewett.co.uk\/blog\/2739\/installing-influxdb-on-a-raspberry-pi\/","url_meta":{"origin":239,"position":1},"title":"Installing InfluxDB on a Raspberry Pi","author":"Chewett","date":"December 5, 2020","format":false,"excerpt":"Today I am writing a quick describing how you can install InfluxDB on a Raspberry Pi What is InfluxDB? InfluxDB is a relatively popular time series database that allows storing metrics and data. It is specifically designed to store and operate on data that is bound by a time component.\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/11\/raspberrypi_influxdb_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/11\/raspberrypi_influxdb_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/11\/raspberrypi_influxdb_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/11\/raspberrypi_influxdb_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/11\/raspberrypi_influxdb_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":409,"url":"https:\/\/chewett.co.uk\/blog\/409\/setting-raspberry-pi-cluster-node\/","url_meta":{"origin":239,"position":2},"title":"Setting up a Raspberry Pi Cluster Node","author":"Chewett","date":"August 19, 2017","format":false,"excerpt":"To set up a Raspberry Pi node I will follow a specific set of steps so that every Pi is set up \u00a0similarly. For the initial deployment I will follow this once and then clone the SD Card multiple times. If at a later date more are added I will\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/setting_up_a_raspi_cluster_node.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/setting_up_a_raspi_cluster_node.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/setting_up_a_raspi_cluster_node.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/setting_up_a_raspi_cluster_node.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1045,"url":"https:\/\/chewett.co.uk\/blog\/1045\/windows-10-fall-creators-edition-samba-mounts-no-longer-working\/","url_meta":{"origin":239,"position":3},"title":"Windows 10 Fall Creators Edition Samba mounts no longer working","author":"Chewett","date":"March 3, 2018","format":false,"excerpt":"This post\u00a0describes what you can do if your accessing samba shares no longer works on Windows 10 Fall Creators Edition. Windows 10 Samba mounts no longer working Microsoft have started disabling SMB1 protocol for samba mounts. This means that any samba mounts that use SMB1 will not be accessible. This\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/fixing_smb1_mounts_windows.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/fixing_smb1_mounts_windows.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/fixing_smb1_mounts_windows.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/fixing_smb1_mounts_windows.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":375,"url":"https:\/\/chewett.co.uk\/blog\/375\/setting-up-the-ci20-for-the-cluster\/","url_meta":{"origin":239,"position":4},"title":"Setting up the CI20 for the cluster","author":"Chewett","date":"October 27, 2018","format":false,"excerpt":"This post talks about the steps I have followed to set up my Creator CI20 for the Raspberry Pi Cluster. Burning Debian to the onboard NAND and configuring it To run the CI20 on the Raspberry Pi Cluster I am going to write Debian 8 to the NAND storage. First\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":313,"url":"https:\/\/chewett.co.uk\/blog\/313\/adding-heatsinks-rasperry-pi-cluster\/","url_meta":{"origin":239,"position":5},"title":"Adding Heatsinks to Rasperry Pi Cluster","author":"Chewett","date":"December 2, 2017","format":false,"excerpt":"Today I am adding some heat sinks to the Raspberry Pi Cluster and why you might want to. Adding some Heat Sinks to my Raspberry Pi's One of the things we can do to reduce the temperature of the Raspberry Pi CPU's is to add a small heat sink. This\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/main_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/main_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/main_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/main_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=239"}],"version-history":[{"count":5,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/239\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}