<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Techy Things &#187; network</title>
	<atom:link href="https://tech.yipp.ca/category/network/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.yipp.ca</link>
	<description>Just another Yipp.ca Blogs site</description>
	<lastBuildDate>Thu, 01 May 2025 18:06:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>SAMBA: Share a folder in linux and access via Windows</title>
		<link>https://tech.yipp.ca/centos-7/howto-samba-folder-linux-access-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=howto-samba-folder-linux-access-windows</link>
		<comments>https://tech.yipp.ca/centos-7/howto-samba-folder-linux-access-windows/#comments</comments>
		<pubDate>Tue, 05 Mar 2013 19:02:47 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 7]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[share files]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[smb.conf]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=116</guid>
		<description><![CDATA[<p>Share a folder in Linux (CentOS, Debian) using samba (smb) &#160; Solution: The solution I'm using is with Samba. I'm using the username frank but please replace this with any username you wish. If&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/centos-7/howto-samba-folder-linux-access-windows/">SAMBA: Share a folder in linux and access via Windows</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h1>Share a folder in Linux (CentOS, Debian) using samba (smb)</h1>
<p>&nbsp;</p>
<h2>Solution:</h2>
<p>The solution I'm using is with Samba. I'm using the username <strong>frank</strong> but please replace this with any username you wish. If you are using CentOS or Red Hat, replace "apt-get" by "yum" in the instructions below.</p>
<pre>DEBIAN: sudo apt-get install samba
CENTOS: sudo yum install samba
FEDORA: sudo /usr/bin/dnf install samba</pre>
<pre>sudo nano /etc/samba/smb.conf</pre>
<p>Uncomment this line in the global section to fix problem with <a href="http://tech.yipp.ca/git/git-keeps-changing-my-file-permissions-when-on-samba/">file permission changing when editing with Windows</a>:</p>
<pre>;map archive = no</pre>
<pre>to</pre>
<pre>map archive = no</pre>
<p>Add this at the end:</p>
<pre>[www]
comment = www
path = /var/www
valid users = @users
force group = users
create mask = 0770
directory mask = 0770
writable = yes


</pre>
<p>Save and close</p>
<pre>$&gt; sudo smbpasswd -a <strong>frank</strong></pre>
<pre>$&gt; sudo chgrp users /var/www</pre>
<pre>$&gt; sudo usermod -a -G users <strong>frank</strong>  (this adds the user frank to group users)</pre>
<p>Also make sure that SE linux is permissive or disabled (see troubleshooting below) or that you enable some parameter if SE linux is kept enabled (this is the preferred solution).</p>
<pre>$&gt; sudo setsebool -P samba_enable_home_dirs on
$&gt; sudo chcon -Rt samba_share_t /your/shared/path/
# the -R is for recursive</pre>
<p>On CentOS 7, you need to disable the firewall like this:</p>
<pre>$&gt; firewall-cmd --permanent --zone=public --add-service=samba
$&gt; firewall-cmd --reload
</pre>
<p>reboot</p>
<h3>Mounting VFAT partitions for easy sharing within a group</h3>
<p>Add gid=100, and change the permission umask 0007  (Warning! The permission numbers in fstab have a completely different numbering scheme than on shell !)</p>
<table>
<tbody>
<tr>
<td style="text-align: left;">
<pre>#
# /etc/fstab
# Created by anaconda on Tue Jan 27 22:34:57 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=946c560f-5087-4c21-b3c7-48cf2875b07c /                       xfs     defaults        1 1
UUID=28C2-AB46          /django                <strong> vfat    umask=0007,gid=100,shortname=winnt</strong> 0 0
UUID=88b09e0f-fab3-4a8c-b381-0416a28bf68e swap                    swap    defaults        0 0</pre>
</td>
</tr>
</tbody>
</table>
<h2></h2>
<h2>Troubleshooting:</h2>
<p>You might want to check if samba service is running:</p>
<pre>$&gt; sudo service --status-all | grep smb</pre>
<p>Usually it's called "smbd"</p>
<p>If it's not, confirm that samba is installed :</p>
<pre>$&gt; sudo apt-get install samba

or</pre>
<pre>$&gt; sudo yum install samba</pre>
<pre>And try to start the service</pre>
<pre>CentOS: $&gt; sudo /sbin/service smb start 
        $&gt; chkconfig smb on # to turn it on at reboot
Debian: $&gt; sudo service samba start
Ubuntu: $&gt; sudo service smbd start

Another problem could be the workgroup. Verify and edit the line workgroup = MYGROUP in /etc/samba/smb.conf, restart service

Another problem could be that SE linux is enabled. If you want to keep SE linux enabled, learn more at <a href="http://sharadchhetri.com/2013/02/17/how-to-install-and-configure-samba-server-in-centos-6/" target="_blank">http://sharadchhetri.com/2013/02/17/how-to-install-and-configure-samba-server-in-centos-6/

</a>To learn about SE linux status, type $&gt; <!--StartFragment-->sestatus <!--EndFragment-->

If you want to set SE linux into permissive mode, type :

$&gt; sudo gedit /etc/selinux/config

SELINUX=permissive

Another problem could be the firewall, to do a quick test, disable the firewall :

$&gt; sudo service iptables save
$&gt; sudo service iptables stop
$&gt; sudo chkconfig iptables off
$&gt; sudo service smb restart # or whatever command you use on your distribution to restart samba</pre>
<p>Another problem is that you are running a virtual machine under a NAT. Use bridged mode instead. Also try pinging the machine IP address first.</p>
<p>Then finally another trick that did the job on a VM that was start / paused and kept running for months was simply to restart SMB. On this system the process were still running and displayed but had become unresponsive as if closed :</p>
<pre>$&gt; sudo service smb restart</pre>
<h2>For a public share</h2>
<p>[public]<br />
comment = Www<br />
path = /var/www<br />
guest ok = yes<br />
public = yes<br />
create mask = 0777<br />
directory mask = 0777<br />
writable = yes</p>
<h2>For CentOS 7 the instructions are slightly different</h2>
<pre>systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service

If you keep the firewall open :</pre>
<pre>firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload

If you leave SELINUX on, you need :</pre>
<pre>chcon -t samba_share_t my-shared-folder/</pre>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/centos-7/howto-samba-folder-linux-access-windows/">SAMBA: Share a folder in linux and access via Windows</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/centos-7/howto-samba-folder-linux-access-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
