thaicosmic.com

หนัง

วันอังคารที่ 18 พฤศจิกายน พ.ศ. 2557

http://kodi.wiki/view/Samba

Samba

Home icon grey.png ▶ SMB▶ Samba
Samba the Linux and Unix implementation SMB/CIFS (aka, Windows File Sharing). If it is not included in a given OS distro, it can be installed easily to share files to XBMC (among other uses). Samba/SMB is often a good choice due to it being highly compatible with other computers, regardless of the OS.

Contents

 [hide

1 Installing

Gentoo
emerge samba
Debian/Ubuntu
sudo apt-get install samba

1.1 Compile from source

Installing Samba regardless of distro
wget http://us4.samba.org/samba/ftp/samba-latest.tar.gz
tar -xvf samba-latest.tar.gz
cd samba-{version}
./configure
make install

2 Configuring

Note: The example below is for a public share.
Samba's configuration is stored /etc/samba/smb.conf. All the following items should be placed in that file.

2.1 Global configuration

[global]
workgroup = >

netbios name =  of server>
server string = ></span></span></span><br>log file = /var/log/samba/log.%m<br>max log size = 50<br>map to guest = bad user<br>socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192<br>local master = no<br>dns proxy = no</div> </div> <dl style="margin-top: 0.2em; margin-bottom: 0.5em;"><dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;"> <dl style="margin-top: 0.2em; margin-bottom: 0.5em;"> <dt style="font-weight: bold; margin-bottom: 0.1em;">workgroup </dt> <dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;">Should be set to the workgroup your home pc uses if you planning on accessing this share from a windows PC</dd> <dt style="font-weight: bold; margin-bottom: 0.1em;">netbios name </dt> <dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;">This is the name that will be displayed when browsing the your Network Neighborhood</dd> <dt style="font-weight: bold; margin-bottom: 0.1em;">server string </dt> <dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;">The title of the server that will be displayed in windows(This is not the share name)</dd></dl> </dd></dl> <h3 style="margin: 0px 0px 0.3em; overflow: hidden; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-style: none; width: auto; font-size: 17px; background-image: none; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"> <span class="mw-headline" id="Share_configuration">2.2 Share configuration</span></h3> <div dir="ltr" class="mw-geshi mw-content-ltr" style="direction: ltr; padding: 1em; border: 1px dashed rgb(47, 111, 171); line-height: 1.1em; background-color: rgb(249, 249, 249);"> <div class="xml source-xml" style="line-height: normal; font-family: monospace;"> [public]<br>path = <span class="sc3" style="color: rgb(0, 153, 0);"><span class="re1" style="color: rgb(0, 0, 0); font-weight: bold;"><dir</span> to share<span class="re2" style="color: rgb(0, 0, 0); font-weight: bold;">></span></span><br>public = yes<br>only guest = yes<br>writable = yes</div> </div> <dl style="margin-top: 0.2em; margin-bottom: 0.5em;"><dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;"> <dl style="margin-top: 0.2em; margin-bottom: 0.5em;"> <dt style="font-weight: bold; margin-bottom: 0.1em;">path</dt> <dd style="line-height: 1.5em; margin-left: 1.6em; margin-bottom: 0.1em; margin-right: 0px;">Set this to the path to be shared by samba</dd></dl> </dd></dl> <p style="margin-top: 0.4em; margin-bottom: 0.5em; line-height: 1.5em;"> Run <code style="font-family: monospace, Courier; background-color: rgb(249, 249, 249);">testparm</code> to check your smb.conf for internal correctness.</p> <p style="margin-top: 0.4em; margin-bottom: 0.5em; line-height: 1.5em;"> Finally resart samba service.</p> <div dir="ltr" class="mw-geshi mw-content-ltr" style="direction: ltr; padding: 1em; border: 1px dashed rgb(47, 111, 171); line-height: 1.1em; background-color: rgb(249, 249, 249);"> <div class="bash source-bash" style="line-height: normal; font-family: monospace;"> <span class="kw2" style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> service smdb restart<br><br><span class="co0" style="color: rgb(102, 102, 102); font-style: italic;"># or</span><br><br><span class="kw2" style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> smbd restart</div> </div> </div> </div>