<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux on The Accidental Admin</title><link>https://accidentaladmin.fyi/tags/linux/</link><description>Recent content in Linux on The Accidental Admin</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>andrew.m.higgs@gmail.com (The Accidental Admin Team)</managingEditor><webMaster>andrew.m.higgs@gmail.com (The Accidental Admin Team)</webMaster><lastBuildDate>Tue, 11 Aug 2026 22:15:00 +0200</lastBuildDate><atom:link href="https://accidentaladmin.fyi/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>A Beginner's Guide to Running a Samba Server on Linux</title><link>https://accidentaladmin.fyi/guides/howto-samba-setup/</link><pubDate>Tue, 11 Aug 2026 22:15:00 +0200</pubDate><author>andrew.m.higgs@gmail.com (The Accidental Admin Team)</author><guid>https://accidentaladmin.fyi/guides/howto-samba-setup/</guid><description>&lt;p&gt;Sharing files between different operating systems can sometimes feel like a hassle. Fortunately, &lt;strong&gt;Samba&lt;/strong&gt; makes it easy to share files and printers across a network, allowing Windows, macOS, and Linux machines to communicate seamlessly.&lt;/p&gt;
&lt;p&gt;This guide will walk you through setting up a basic, password-protected Samba file share on a Linux system (specifically using Ubuntu/Debian-based commands).&lt;/p&gt;
&lt;h2 id="step-1-install-samba"&gt;Step 1: Install Samba &lt;a href="#step-1-install-samba" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;First, you need to update your package list and install the Samba software. Open your terminal and run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install samba -y
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To verify that Samba installed correctly, you can check its status:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl status smbd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-2-create-a-shared-directory"&gt;Step 2: Create a Shared Directory &lt;a href="#step-2-create-a-shared-directory" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Next, let&amp;rsquo;s create the folder you want to share over the network. We&amp;rsquo;ll create a folder called &lt;code&gt;sambashare&lt;/code&gt; in your home directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir ~/sambashare
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-3-configure-the-samba-share"&gt;Step 3: Configure the Samba Share &lt;a href="#step-3-configure-the-samba-share" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Samba&amp;rsquo;s configuration is handled by a single file located at &lt;code&gt;/etc/samba/smb.conf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Before making changes, it&amp;rsquo;s always a good idea to back up the original configuration file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, open the configuration file in a text editor (like &lt;code&gt;nano&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo nano /etc/samba/smb.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Scroll all the way to the bottom of the file and add the following lines:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;[sambashare]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;comment&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;Samba on Ubuntu
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; path = /home/username/sambashare
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; read only = no
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; browsable = yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: Replace &lt;code&gt;username&lt;/code&gt; with your actual Linux username.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Save and exit the file (in nano, press &lt;code&gt;CTRL+O&lt;/code&gt;, &lt;code&gt;Enter&lt;/code&gt;, then &lt;code&gt;CTRL+X&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id="step-4-set-up-a-samba-user-password"&gt;Step 4: Set Up a Samba User Password &lt;a href="#step-4-set-up-a-samba-user-password" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Samba uses its own password management system. You need to add your current Linux user to Samba and set a password.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo smbpasswd -a username
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: Again, replace &lt;code&gt;username&lt;/code&gt; with your actual Linux username. You will be prompted to create and confirm a password.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="step-5-restart-the-samba-service"&gt;Step 5: Restart the Samba Service &lt;a href="#step-5-restart-the-samba-service" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For your new configuration to take effect, you need to restart the Samba service:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo systemctl restart smbd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;(Optional) If you have a firewall enabled (like UFW), you&amp;rsquo;ll need to allow Samba traffic:&lt;/em&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ufw allow samba
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-6-connect-to-your-share"&gt;Step 6: Connect to Your Share &lt;a href="#step-6-connect-to-your-share" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Your Samba server is now up and running! Here is how to access it from different devices:&lt;/p&gt;
&lt;h3 id="from-windows"&gt;From Windows: &lt;a href="#from-windows" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;File Explorer&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the address bar at the top, type &lt;code&gt;\\IP_ADDRESS\sambashare&lt;/code&gt; (Replace &lt;code&gt;IP_ADDRESS&lt;/code&gt; with your Linux machine&amp;rsquo;s local IP address, which you can find by typing &lt;code&gt;ip a&lt;/code&gt; in the terminal).&lt;/li&gt;
&lt;li&gt;When prompted, enter the username and the Samba password you created in Step 4.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="from-macos"&gt;From macOS: &lt;a href="#from-macos" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Finder&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Go to the menu bar and click &lt;strong&gt;Go&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Connect to Server&lt;/strong&gt; (or press &lt;code&gt;Cmd + K&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;smb://IP_ADDRESS/sambashare&lt;/code&gt; and click Connect.&lt;/li&gt;
&lt;li&gt;Enter your Samba credentials.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="from-another-linux-machine"&gt;From another Linux machine: &lt;a href="#from-another-linux-machine" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your file manager and look for a &amp;ldquo;Network&amp;rdquo; or &amp;ldquo;Other Locations&amp;rdquo; tab, then type:
&lt;code&gt;smb://IP_ADDRESS/sambashare&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt; You&amp;rsquo;ve just set up your own cross-platform file server using Samba.&lt;/p&gt;</description></item><item><title>Welcome to The Accidental Admin</title><link>https://accidentaladmin.fyi/posts/first-post/</link><pubDate>Tue, 11 Aug 2026 00:00:00 +0000</pubDate><author>andrew.m.higgs@gmail.com (The Accidental Admin Team)</author><guid>https://accidentaladmin.fyi/posts/first-post/</guid><description>&lt;p&gt;This is a simple introduction to our blog&amp;hellip;&lt;/p&gt;</description></item></channel></rss>