Samba Server mit BSD

Manchmal braucht man dann doch ein von Windows mountbares Storage.
Das tut Samba machen.


Installiert wird Version 3.0.0

Installation:
# cd /usr/ports/net/samba
/usr/ports/net/samba # make && make install && make clean

Konfiguration:
Ich führe hier nur auf was ich geändert/hinzugefügt habe.
# cp /usr/local/etc/smb.conf.default /usr/local/etc/smb.conf
# vi /usr/local/etc/smb.conf

[global]

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user „nobody“ is used
map to guest = Bad User
guest account = nobody
security = user

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes

# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/sambalog.%m

#============================ Share Definitions ==============================
[ftp]
comment = Temporary file space
path = /usr/local/var/sambashare
guest ok = yes
read only = no
public = yes

Erzeugen des Sambashareverzeichnisses:
# mkdir /usr/local/var/sambashare
# chown nobody:nobody /usr/local/var/sambashare
# chmod 774 /usr/local/var/sambashare

Testen der Konfig:
# testparm

Meldungen wie:

Error trying to resolve symbol ‚init_module‘ in /usr/local/etc/charset/CP850.so:
Cannot open „/usr/local/etc/charset/US-ASCII.so“ Conversion from UCS-2LE to CP850
not supported

können eigentlich ignoriert werden.

Wenn sonst nix beanstandet wurde: das Startscript umbenennen und ausführen.
# cp /usr/local/etc/rc.d/samba.sh.sample /usr/local/etc/rc.d/samba.sh
# /usr/local/etc/rc.d/samba.sh

… mit Windows „123.123.123.123\ftp\“ mounten. Fertig.