FreeBSD: Install & Config Samba

1.At first update the server’s repository information.

$ sudo pkg update

2.Search Samba in PKG.

$ pkg search samba

3.Install the last version Samba.

$ sudo pkg install samba46

Sample Output:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 33 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
samba46: 4.6.8
libsunacl: 1.0
gnutls: 3.5.15
trousers: 0.3.14_1
tpm-emulator: 0.7.4_2
gmp: 6.1.2
p11-kit: 0.23.8
libtasn1: 4.12
ca_root_nss: 3.32.1
libffi: 3.2.1_1
libiconv: 1.14_11
nettle: 3.3
libidn2: 2.0.4
libunistring: 0.9.7
openldap-client: 2.4.45
python27: 2.7.14
python2: 2_3
py27-dnspython: 1.15.0
py27-setuptools: 36.2.2
tevent: 0.9.31
talloc: 2.1.9
py27-iso8601: 0.1.11
popt: 1.16_2
libinotify: 20170711_1
gamin: 0.1.10_9
glib: 2.50.2_6,1
pcre: 8.40_1
tdb: 1.3.12,1
ldb: 1.1.29_1
libarchive: 3.3.1,1
expat: 2.2.1
lzo2: 2.10_1
liblz4: 1.8.0,1

Number of packages to be installed: 33

The process will require 272 MiB more space.
47 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/33] Fetching samba46-4.6.8.txz: 100% 23 MiB 24.1MB/s 00:01
[2/33] Fetching libsunacl-1.0.txz: 100% 7 KiB 6.9kB/s 00:01
[3/33] Fetching gnutls-3.5.15.txz: 100% 2 MiB 2.2MB/s 00:01
[4/33] Fetching trousers-0.3.14_1.txz: 100% 463 KiB 474.1kB/s 00:01
[5/33] Fetching tpm-emulator-0.7.4_2.txz: 100% 112 KiB 114.5kB/s 00:01
[6/33] Fetching gmp-6.1.2.txz: 100% 463 KiB 474.4kB/s 00:01
[7/33] Fetching p11-kit-0.23.8.txz: 100% 390 KiB 399.2kB/s 00:01
[8/33] Fetching libtasn1-4.12.txz: 100% 603 KiB 617.6kB/s 00:01
[9/33] Fetching ca_root_nss-3.32.1.txz: 100% 309 KiB 316.8kB/s 00:01
[10/33] Fetching libffi-3.2.1_1.txz: 100% 34 KiB 35.1kB/s 00:01
[11/33] Fetching libiconv-1.14_11.txz: 100% 601 KiB 615.2kB/s 00:01
[12/33] Fetching nettle-3.3.txz: 100% 1 MiB 1.1MB/s 00:01
[13/33] Fetching libidn2-2.0.4.txz: 100% 98 KiB 100.6kB/s 00:01
[14/33] Fetching libunistring-0.9.7.txz: 100% 599 KiB 613.1kB/s 00:01
[15/33] Fetching openldap-client-2.4.45.txz: 100% 1 MiB 1.0MB/s 00:01
[16/33] Fetching python27-2.7.14.txz: 100% 10 MiB 11.0MB/s 00:01
[17/33] Fetching python2-2_3.txz: 100% 1 KiB 1.1kB/s 00:01
[18/33] Fetching py27-dnspython-1.15.0.txz: 100% 170 KiB 174.2kB/s 00:01
[19/33] Fetching py27-setuptools-36.2.2.txz: 100% 441 KiB 451.9kB/s 00:01
[20/33] Fetching tevent-0.9.31.txz: 100% 48 KiB 48.8kB/s 00:01
[21/33] Fetching talloc-2.1.9.txz: 100% 52 KiB 53.5kB/s 00:01
[22/33] Fetching py27-iso8601-0.1.11.txz: 100% 12 KiB 11.9kB/s 00:01
[23/33] Fetching popt-1.16_2.txz: 100% 61 KiB 62.3kB/s 00:01
[24/33] Fetching libinotify-20170711_1.txz: 100% 24 KiB 24.3kB/s 00:01
[25/33] Fetching gamin-0.1.10_9.txz: 100% 49 KiB 50.3kB/s 00:01
[26/33] Fetching glib-2.50.2_6,1.txz: 100% 3 MiB 2.9MB/s 00:01
[27/33] Fetching pcre-8.40_1.txz: 100% 1 MiB 1.1MB/s 00:01
[28/33] Fetching tdb-1.3.12,1.txz: 100% 83 KiB 85.4kB/s 00:01
[29/33] Fetching ldb-1.1.29_1.txz: 100% 199 KiB 204.1kB/s 00:01
[30/33] Fetching libarchive-3.3.1,1.txz: 100% 694 KiB 710.2kB/s 00:01
[31/33] Fetching expat-2.2.1.txz: 100% 104 KiB 106.7kB/s 00:01
[32/33] Fetching lzo2-2.10_1.txz: 100% 113 KiB 115.4kB/s 00:01
[33/33] Fetching liblz4-1.8.0,1.txz: 100% 92 KiB 93.8kB/s 00:01
Checking integrity... done (0 conflicting)
[1/33] Installing libffi-3.2.1_1...
[1/33] Extracting libffi-3.2.1_1: 100%
[2/33] Installing python27-2.7.14...
[2/33] Extracting python27-2.7.14: 100%
[3/33] Installing gmp-6.1.2...
[3/33] Extracting gmp-6.1.2: 100%
[4/33] Installing python2-2_3...
[4/33] Extracting python2-2_3: 100%
[5/33] Installing tpm-emulator-0.7.4_2...
===> Creating groups.
Creating group '_tss' with gid '601'.
===> Creating users
Creating user '_tss' with uid '601'.
[5/33] Extracting tpm-emulator-0.7.4_2: 100%
[6/33] Installing libtasn1-4.12...
[6/33] Extracting libtasn1-4.12: 100%
[7/33] Installing ca_root_nss-3.32.1...
[7/33] Extracting ca_root_nss-3.32.1: 100%
[8/33] Installing libiconv-1.14_11...
[8/33] Extracting libiconv-1.14_11: 100%
[9/33] Installing libunistring-0.9.7...
[9/33] Extracting libunistring-0.9.7: 100%
[10/33] Installing talloc-2.1.9...
[10/33] Extracting talloc-2.1.9: 100%
[11/33] Installing pcre-8.40_1...
[11/33] Extracting pcre-8.40_1: 100%
[12/33] Installing trousers-0.3.14_1...
===> Creating groups.
Using existing group '_tss'.
===> Creating users
Using existing user '_tss'.
[12/33] Extracting trousers-0.3.14_1: 100%
[13/33] Installing p11-kit-0.23.8...
[13/33] Extracting p11-kit-0.23.8: 100%
[14/33] Installing nettle-3.3...
[14/33] Extracting nettle-3.3: 100%
[15/33] Installing libidn2-2.0.4...
[15/33] Extracting libidn2-2.0.4: 100%
[16/33] Installing openldap-client-2.4.45...
[16/33] Extracting openldap-client-2.4.45: 100%
[17/33] Installing py27-setuptools-36.2.2...
[17/33] Extracting py27-setuptools-36.2.2: 100%
[18/33] Installing tevent-0.9.31...
[18/33] Extracting tevent-0.9.31: 100%
[19/33] Installing popt-1.16_2...
[19/33] Extracting popt-1.16_2: 100%
[20/33] Installing glib-2.50.2_6,1...
[20/33] Extracting glib-2.50.2_6,1: 100%
No schema files found: doing nothing.
[21/33] Installing tdb-1.3.12,1...
[21/33] Extracting tdb-1.3.12,1: 100%
[22/33] Installing expat-2.2.1...
[22/33] Extracting expat-2.2.1: 100%
[23/33] Installing lzo2-2.10_1...
[23/33] Extracting lzo2-2.10_1: 100%
[24/33] Installing liblz4-1.8.0,1...
[24/33] Extracting liblz4-1.8.0,1: 100%
[25/33] Installing libsunacl-1.0...
[25/33] Extracting libsunacl-1.0: 100%
[26/33] Installing gnutls-3.5.15...
[26/33] Extracting gnutls-3.5.15: 100%
[27/33] Installing py27-dnspython-1.15.0...
[27/33] Extracting py27-dnspython-1.15.0: 100%
[28/33] Installing py27-iso8601-0.1.11...
[28/33] Extracting py27-iso8601-0.1.11: 100%
[29/33] Installing libinotify-20170711_1...
[29/33] Extracting libinotify-20170711_1: 100%
[30/33] Installing gamin-0.1.10_9...
[30/33] Extracting gamin-0.1.10_9: 100%
[31/33] Installing ldb-1.1.29_1...
[31/33] Extracting ldb-1.1.29_1: 100%
[32/33] Installing libarchive-3.3.1,1...
[32/33] Extracting libarchive-3.3.1,1: 100%
[33/33] Installing samba46-4.6.8...
Extracting samba46-4.6.8: 100%
Message from python27-2.7.14:
===========================================================================

Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

bsddb databases/py-bsddb
gdbm databases/py-gdbm
sqlite3 databases/py-sqlite3
tkinter x11-toolkits/py-tkinter

===========================================================================
Message from ca_root_nss-3.32.1:
********************************* WARNING *********************************

FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.

*********************************** NOTE **********************************

This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

* /etc/ssl/cert.pem
* /usr/local/etc/ssl/cert.pem
* /usr/local/openssl/cert.pem

***************************************************************************
Message from trousers-0.3.14_1:
To run tcsd automatically, add the following line to /etc/rc.conf:

tcsd_enable="YES"

You might want to edit /usr/local/etc/tcsd.conf to reflect your setup.

If you want to use tcsd with software TPM emulator, use the following
configuration in /etc/rc.conf:

tcsd_enable="YES"
tcsd_mode="emulator"
tpmd_enable="YES"

To use TPM, add your_account to '_tss' group like following:

# pw groupmod _tss -m your_account
Message from openldap-client-2.4.45:
************************************************************

The OpenLDAP client package has been successfully installed.

Edit
/usr/local/etc/openldap/ldap.conf
to change the system-wide client defaults.

Try `man ldap.conf' and visit the OpenLDAP FAQ-O-Matic at
http://www.OpenLDAP.org/faq/index.cgi?file=3
for more information.

************************************************************
Message from libinotify-20170711_1:
============================================================================

Libinotify functionality on FreeBSD is missing support for

- detecting a file being moved into or out of a directory within the
same filesystem
- certain modifications to a symbolic link (rather than the
file it points to.)

in addition to the known limitations on all platforms using kqueue(2)
where various open and close notifications are unimplemented.

This means the following regression tests will fail:

Directory notifications:
IN_MOVED_FROM
IN_MOVED_TO

Open/close notifications:
IN_OPEN
IN_CLOSE_NOWRITE
IN_CLOSE_WRITE

Symbolic Link notifications:
IN_DONT_FOLLOW
IN_ATTRIB
IN_MOVE_SELF
IN_DELETE_SELF

Kernel patches to address the missing directory and symbolic link
notifications are available from:

https://github.com/libinotify-kqueue/libinotify-kqueue/tree/master/patches

=============================================================================
You might want to consider increasing the kern.maxfiles tunable if you plan
to use this library for applications that need to monitor activity of a lot
of files.

If the default on your system is too low, add the following line to
/boot/loader.conf, then reboot the system:

kern.maxfiles="25000"
=============================================================================
Message from gamin-0.1.10_9:
===============================================================================

Gamin will only provide realtime notification of changes for at most n files,
where n is the minimum value between (kern.maxfiles * 0.7) and
(kern.maxfilesperproc - 200). Beyond that limit, files will be polled.

If you often open several large folders with Nautilus, you might want to
increase the kern.maxfiles tunable (you do not need to set
kern.maxfilesperproc, since it is computed at boot time from kern.maxfiles).

For a typical desktop, add the following line to /boot/loader.conf, then
reboot the system:

kern.maxfiles="25000"

The behavior of gamin can be controlled via the various gaminrc files.
See http://www.gnome.org/~veillard/gamin/config.html on how to create
these files. In particular, if you find gam_server is taking up too much
CPU time polling for changes, something like the following may help
in one of the gaminrc files:

# reduce polling frequency to once per 10 seconds
# for UFS file systems in order to lower CPU load
fsset ufs poll 10

===============================================================================

===> NOTICE:

The gamin port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from samba46-4.6.8:
===============================================================================

How to start: http://wiki.samba.org/index.php/Samba4/HOWTO

* Your configuration is: /usr/local/etc/smb4.conf

* All the relevant databases are under: /var/db/samba4

* All the logs are under: /var/log/samba4

* Provisioning script is: /usr/local/bin/samba-tool

For additional documentation check: http://wiki.samba.org/index.php/Samba4

Bug reports should go to the: https://bugzilla.samba.org/

===============================================================================

4. Make Share folder.

$ sudo mkdir /usr/local/public
$ sudo chmod 777 /usr/local/pullic

5. Create file /usr/local/etc/smb4.conf.
[global]
workgroup=WORKGROUP
server string=FreeBSD
netbios name=freebsd
security=user
map to guest=Bad User
log file = /var/log/samba4/log.%m
max log size = 50

[share]
comment=Public Share
path=/usr/local/public
read only=No
create mask=0777
directory mask=0777
guest only=Yes
guest ok=Yes
browseable=Yes

6. Check Config file.

$ sudo testparm -v

7. Set samba_server_enable=YES in /etc/rc.conf.

$ sudo sysrc samba_server_enable=YES

8. Start samba service.

$ sudo service samba_server start

Comments

Popular posts from this blog

Python3 + Django + uWSGI + Nginx On FreeBSD

arduino最小構成 (atmega328/8MHz/3.3V/内部クロック)FT232RLにてブートローダーの書き込み

FreeBSD: Configuring Apache to permit CGI