Устанавливаем Samba из портов:
Код: Выделить всё
# cd /usr/ports/net/samba
# make install clean CLEANDEPENDS=Yes
Код: Выделить всё
# export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.5/packages/i386/
# pkg_add samba-3.0.33.tgz
Код: Выделить всё
# mkdir -p /var/samba/{public,music}
# chmod 777 /var/samba/public
Код: Выделить всё
# vi /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
netbios name = Server
server string = Samba Server %v
security = share
hosts allow = 192.168.2. 127.
load printers = no
guest account = nobody
guest ok = yes
log file = /var/log/smbd.%m
max log size = 1024
interfaces = fxp1 lo0
; bind interfaces only = yes
local master = no
os level = 1
domain master = no
preferred master = no
wins support = no
wins proxy = no
dns proxy = no
dos charset = cp866
unix charset = koi8-r
[public]
path = /var/samba/public
comment = Share folder
browseable = yes
writable = yes
; create mask = 0644
; directory mask = 0775
[music]
path = /var/samba/music
comment = Music files
browseable = yes
writeable = no
Код: Выделить всё
# testparm /etc/samba/smb.conf
Код: Выделить всё
# /usr/local/libexec/smbd -D
# /usr/local/libexec/nmbd -D
Код: Выделить всё
# smbclient -U% -L localhost
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]
Sharename Type Comment
--------- ---- -------
public Disk Share folder
music Disk Music files
IPC$ IPC IPC Service (Samba Server 3.0.33)
изменения в /etc/rc.local:
Код: Выделить всё
# vi /etc/rc.local
if [ -x /usr/local/libexec/smbd ]; then
echo -n ' smbd'; /usr/local/libexec/smbd -D
fi
if [ -x /usr/local/libexec/nmbd ]; then
echo -n ' nmbd'; /usr/local/libexec/nmbd -D
fi
Код: Выделить всё
vi /etc/inetd.conf
901 stream tcp nowait.400 root /usr/local/libexec/swat swat
Код: Выделить всё
kill -HUP `head -1 /var/run/inetd.pid`
Код: Выделить всё
vi /etc/stunnel/stunnel.conf
[swats]
accept = 902
connect = 901
источник