{"id":4009,"date":"2021-12-02T12:32:20","date_gmt":"2021-12-02T07:02:20","guid":{"rendered":"https:\/\/www.helptoinstall.com\/?p=4009"},"modified":"2026-01-29T17:00:12","modified_gmt":"2026-01-29T11:30:12","slug":"install-and-configure-samba-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/","title":{"rendered":"Install and Configure Samba In Ubuntu"},"content":{"rendered":"\n<p>A Samba file server is a network-based file sharing solution that allows users to share files across multiple operating systems.<br>You can share files with other Windows and Mac users and access desktop files from a laptop using this software. This article will walk you through the process of How to install and configure Samba on Ubuntu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-installing-samba\"><strong>Installing Samba<\/strong><\/h2>\n\n\n\n<p>To install Samba, we execute the following prompts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo apt update\nsudo apt install samba<\/strong><\/code><\/pre>\n\n\n\n<p>We can ascertain if the installation was successful by executing the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>whereis samba<\/strong><\/code><\/pre>\n\n\n\n<p>The following should be the output of the programme:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>samba: \/usr\/sbin\/samba \/usr\/lib\/samba \/etc\/samba \/usr\/share\/samba \/usr\/share\/man\/man7\/samba.7.gz \/usr\/share\/man\/man8\/samba.8.gz<\/strong><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-setting-up-samba\"><strong>Setting up Samba<\/strong><\/h3>\n\n\n\n<p>Now that Samba has been installed, we need to create a directory for it to use as a sharing point:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>mkdir \/home\/&lt;username&gt;\/sambashare\/<\/strong><\/code><\/pre>\n\n\n\n<p>The command above creates a new folder named <strong>sambashare<\/strong> in our home directory, which we will use to transfer content later on in the process.<\/p>\n\n\n\n<p>The Samba configuration file can be discovered at the following location<strong>: \/etc\/samba\/smb.conf<\/strong>.<br>To add the new directory as a share, we ought to edit the file by running the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo nano \/etc\/samba\/smb.conf<\/strong><\/code><\/pre>\n\n\n\n<p>Towards the end of the document, insert the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&#91;sambashare]\n    comment = Samba on Ubuntu\n    path = \/home\/username\/sambashare\n    read only = no\n    browsable = yes<\/strong><\/code><\/pre>\n\n\n\n<p>Then press the <strong>Ctrl-O<\/strong> key to save your work and the <strong>Ctrl-X<\/strong> key to exit the nano text editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-what-we-ve-just-tacked-on-is\"><strong>What we&#8217;ve just tacked on is<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>comment: A succinct description of the share.<\/li>\n\n\n\n<li>path: The location of our shared directory.<\/li>\n\n\n\n<li>only to be read:This directive has the effect of only granting permission to modify the contents of a shared folder when the value of the directive is <strong>no<\/strong>.<\/li>\n\n\n\n<li>The value &#8220;<strong>browsable<\/strong>&#8221; suggests that file managers such as Ubuntu&#8217;s default file manager will list this share under the &#8220;Network&#8221; category when the value is &#8220;<strong>yes<\/strong>&#8221; (it could also appear as browseable).<\/li>\n<\/ol>\n\n\n\n<p>Now that we&#8217;ve established our new share, we&#8217;ll require to save it and restart Samba in order for it to be impactful:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo service smbd restart<\/strong><\/code><\/pre>\n\n\n\n<p>Reconfigure the firewall rules to allow Samba traffic to pass through:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo ufw allow samba<\/strong><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-setting-up-user-accounts-and-connecting-to-share\"><strong>Setting up User Accounts and Connecting to Share<\/strong><\/h3>\n\n\n\n<p>As the system account password is not used by Samba, we must create a separate Samba password for our user account:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo smbpasswd -a username<\/code><\/pre>\n\n\n\n<p>It is important to note that the username entered must be associated with a system account in order for it to be saved.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-connecting-to-share\"><strong>Connecting to Share<\/strong><\/h3>\n\n\n\n<p>Regarding Ubuntu:<br>Open the default file manager and select Connect to Server from the drop-down menu. Then type in the following:<\/p>\n\n\n\n<p><strong>smb:\/\/ip-address\/sambashare<\/strong><\/p>\n\n\n\n<p>On Mac OS X, the following is true:<br>Select Go &gt; Connect to Server from the Finder menu, and then enter the following information:<\/p>\n\n\n\n<p><strong>smb:\/\/ip-address\/sambashare<\/strong><\/p>\n\n\n\n<p>Open File Manager on your virtual machine and modify the path to the file to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>\\\\ip-address\\sambashare<\/strong><\/code><\/pre>\n\n\n\n<p>Note that ip-address is the IP address of the Samba server, and sambashare is the name of the shared folder.<\/p>\n\n\n\n<p>You&#8217;ll be prompted to enter your user credentials.<br>Connect with them by entering their information!<\/p>\n\n\n\n<p>Need help on How to Install and Configure Samba In Ubuntu, <a href=\"https:\/\/www.hostnats.com\/contact-us\">Contact us<\/a> for more details<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Samba file server is a network-based file sharing solution that allows users to share files across multiple operating systems.You can share files with other Windows and Mac users and access desktop files from a laptop using this software. This article will walk you through the process of How to install and configure Samba on [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[230,231,232,233],"class_list":["post-4009","post","type-post","status-publish","format-standard","hentry","category-blog","tag-how-to-install-samba","tag-how-to-install-samba-in-ubuntu","tag-samba-configuration","tag-samba-installation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.4 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Install and Configure Samba In Ubuntu - Hostnats<\/title>\n<meta name=\"description\" content=\"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install and Configure Samba In Ubuntu\" \/>\n<meta property=\"og:description\" content=\"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Hostnats\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hostnats\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-02T07:02:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-29T11:30:12+00:00\" \/>\n<meta name=\"author\" content=\"Gopu Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hostnats\" \/>\n<meta name=\"twitter:site\" content=\"@hostnats\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gopu Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\"},\"author\":{\"name\":\"Gopu Kumar\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/#\/schema\/person\/e913d744f9f4f9a2ed5f95c409f5cc10\"},\"headline\":\"Install and Configure Samba In Ubuntu\",\"datePublished\":\"2021-12-02T07:02:20+00:00\",\"dateModified\":\"2026-01-29T11:30:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\"},\"wordCount\":497,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/#organization\"},\"keywords\":[\"how to install samba\",\"how to install samba in ubuntu\",\"samba configuration\",\"samba installation\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\",\"url\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\",\"name\":\"Install and Configure Samba In Ubuntu - Hostnats\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/#website\"},\"datePublished\":\"2021-12-02T07:02:20+00:00\",\"dateModified\":\"2026-01-29T11:30:12+00:00\",\"description\":\"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.hostnats.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install and Configure Samba In Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/#website\",\"url\":\"https:\/\/www.hostnats.com\/blog\/\",\"name\":\"Hostnats\",\"description\":\"The Perfect Hosting Partner\",\"publisher\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hostnats.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/#organization\",\"name\":\"Hostnats Hosting\",\"url\":\"https:\/\/www.hostnats.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.hostnats.com\/blog\/wp-content\/uploads\/2020\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.hostnats.com\/blog\/wp-content\/uploads\/2020\/07\/logo.png\",\"width\":66,\"height\":67,\"caption\":\"Hostnats Hosting\"},\"image\":{\"@id\":\"https:\/\/www.hostnats.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/hostnats\",\"https:\/\/x.com\/hostnats\",\"https:\/\/www.instagram.com\/hostnats_hosting\/\",\"https:\/\/www.linkedin.com\/company\/hostnats\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hostnats.com\/blog\/#\/schema\/person\/e913d744f9f4f9a2ed5f95c409f5cc10\",\"name\":\"Gopu Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g\",\"caption\":\"Gopu Kumar\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Install and Configure Samba In Ubuntu - Hostnats","description":"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"Install and Configure Samba In Ubuntu","og_description":"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!","og_url":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/","og_site_name":"Hostnats","article_publisher":"https:\/\/www.facebook.com\/hostnats","article_published_time":"2021-12-02T07:02:20+00:00","article_modified_time":"2026-01-29T11:30:12+00:00","author":"Gopu Kumar","twitter_card":"summary_large_image","twitter_creator":"@hostnats","twitter_site":"@hostnats","twitter_misc":{"Written by":"Gopu Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/"},"author":{"name":"Gopu Kumar","@id":"https:\/\/www.hostnats.com\/blog\/#\/schema\/person\/e913d744f9f4f9a2ed5f95c409f5cc10"},"headline":"Install and Configure Samba In Ubuntu","datePublished":"2021-12-02T07:02:20+00:00","dateModified":"2026-01-29T11:30:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/"},"wordCount":497,"commentCount":0,"publisher":{"@id":"https:\/\/www.hostnats.com\/blog\/#organization"},"keywords":["how to install samba","how to install samba in ubuntu","samba configuration","samba installation"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/","url":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/","name":"Install and Configure Samba In Ubuntu - Hostnats","isPartOf":{"@id":"https:\/\/www.hostnats.com\/blog\/#website"},"datePublished":"2021-12-02T07:02:20+00:00","dateModified":"2026-01-29T11:30:12+00:00","description":"Learn how to install and configure Samba in Ubuntu to enable file sharing. Follow our step-by-step guide now!","breadcrumb":{"@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hostnats.com\/blog\/install-and-configure-samba-in-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hostnats.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Install and Configure Samba In Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.hostnats.com\/blog\/#website","url":"https:\/\/www.hostnats.com\/blog\/","name":"Hostnats","description":"The Perfect Hosting Partner","publisher":{"@id":"https:\/\/www.hostnats.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostnats.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hostnats.com\/blog\/#organization","name":"Hostnats Hosting","url":"https:\/\/www.hostnats.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostnats.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hostnats.com\/blog\/wp-content\/uploads\/2020\/07\/logo.png","contentUrl":"https:\/\/www.hostnats.com\/blog\/wp-content\/uploads\/2020\/07\/logo.png","width":66,"height":67,"caption":"Hostnats Hosting"},"image":{"@id":"https:\/\/www.hostnats.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hostnats","https:\/\/x.com\/hostnats","https:\/\/www.instagram.com\/hostnats_hosting\/","https:\/\/www.linkedin.com\/company\/hostnats"]},{"@type":"Person","@id":"https:\/\/www.hostnats.com\/blog\/#\/schema\/person\/e913d744f9f4f9a2ed5f95c409f5cc10","name":"Gopu Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a04e307992cf527a3f7224d55ec81767a1094f0278d86fb791aa46b3552bc8c?s=96&d=mm&r=g","caption":"Gopu Kumar"}}]}},"_links":{"self":[{"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/posts\/4009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/comments?post=4009"}],"version-history":[{"count":2,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/posts\/4009\/revisions"}],"predecessor-version":[{"id":6435,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/posts\/4009\/revisions\/6435"}],"wp:attachment":[{"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/media?parent=4009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/categories?post=4009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostnats.com\/blog\/wp-json\/wp\/v2\/tags?post=4009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}