Set samba server on freeBSD

1. server configuration

Samba is configured in /usr/local/etc/smb4.conf.

# touch /usr/local/etc/smb4.conf

smb4.conf is as follows.

[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = ExampleMachine
wins support = Yes
security = user
encrypt passwords = yes
max log size = 500
preferred master = yes
hosts allow = 192.168.1.
interfaces = em0
bind interfaces only = yes
socket options = TCP_NODELAY
passdb backend = tdbsam

# Example: share /path/to/share accessible only to 'test1' user
[src]
path = /usr/home/test1
valid users = test1
writable  = yes
browsable = yes
read only = no
guest ok = no
public = no
create mask = 0666
directory mask = 0755

2. Add user to samba

2.1 Add a new system user

# adduser
Username: test1
...

2.2 Add the new system user(test1) as a samba user.

# smbpasswd  -a test1 
...

3. Start or stop samba

To enable samba at boot time, add the following line to /etc/rc.conf:

samba_server_enable="YES"

To start samba now:

# service samba_server start

To stop samba:

# service samba_server stop
posted @ 2021-10-20 18:11  enjoy_jun  阅读(102)  评论(0编辑  收藏  举报