{"id":122,"date":"2023-04-05T16:51:25","date_gmt":"2023-04-05T14:51:25","guid":{"rendered":"https:\/\/gilbert.busana.lu\/?p=122"},"modified":"2023-04-05T17:06:05","modified_gmt":"2023-04-05T15:06:05","slug":"samba","status":"publish","type":"post","link":"https:\/\/www.homeserver.lu\/?p=122","title":{"rendered":"SAMBA (install and configure)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Install and configure Samba<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo apt-get install samba -y<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Once the software is installed, you\u2019re ready to configure your first share. Open the samba configuration file:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your Samba shares will be configured in <em>\/etc\/samba\/smb.conf<\/em>, so open that file with the command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo nano \/etc\/samba\/smb.conf<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Scroll to the bottom and add the following for each share:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>[ShareName]\u2028\npath = \/var\/www\/www.website.com\u2028\nvalid users = paul\n\u2028browsable = yes\n\u2028writable = yes\u2028\nread only = no<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ShareName] is the visible name of the share when connecting to the server<\/li>\n\n\n\n<li>valid users: the list of users that are allowed to access this share. The user needs to be added to Samba and a password needs to be generated.<\/li>\n\n\n\n<li>path: the absolute path on the disk<\/li>\n\n\n\n<li>browsable: make the share visible or invisible on the network<\/li>\n\n\n\n<li>writable: make the share writable (or not)<\/li>\n\n\n\n<li>read-only: make the share read-only (or not)<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Save (CTRL-O) and close (CTRL-X) the configuration file.<br>Restart the Samba daemon:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo systemctl restart smbd<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Add a user to Samba<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After limiting access to a list of users (see above), you have to add the user to Samba and create a password for him\/her.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo smbpasswd -a paul<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted to enter the password and confirm it for user <em>paul<\/em>. After creating the user, you have to enable him\/her.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enable a user<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo smbpasswd -e paul<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Disable a user<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo smbpasswd -d paul<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Delete a user<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo smbpasswd -x paul<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Install and configure Samba Once the software is installed, you\u2019re ready to configure your first share. Open the samba configuration file: Your Samba shares will be configured in \/etc\/samba\/smb.conf, so open that file with the command: Scroll to the bottom and add the following for each share: Save (CTRL-O) and close (CTRL-X) the configuration file.Restart [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-samba"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=122"}],"version-history":[{"count":13,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions\/142"}],"wp:attachment":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}