File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_set_up_a_samba_server.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sun Feb 5 07:14:36 2012 UTC (2 years, 2 months ago) by schmonz
Branches: MAIN
CVS tags: HEAD
dos2unix

Setting up a samba server on your NetBSD box for WindowsXP clients is really simple. 

Install samba via pkgsrc: 
    
    # cd /usr/pkgsrc/net/samba
    # make install clean
    

Start the services via /etc/inetd.conf then uncomment the next two lines. 
    
    #netbios-ssn stream tcp nowait root /usr/pkg/sbin/smbd
    #netbios-ns dgram udp wait root /usr/pkg/sbin/nmbd
    

Change it to this: 
    
    netbios-ssn stream tcp nowait root /usr/pkg/sbin/smbd
    netbios-ns dgram udp wait root /usr/pkg/sbin/nmbd
    

Save the changes and restart inetd: 
    
    /etc/rc.d/inetd restart
    

Now add the following lines to /etc/rc.conf: 
    
    smbd=YES
    nmbd=YES
    samba=YES
    

You have to create a /usr/pkg/etc/samba/smb.conf with the following basic configuration: 
    
    workgroup="some_group"
    server string="NetBSD Samba Server"
    hosts allow = 192.168.1. , 192.168.0.
    encrypt passwords = yes
    
    
    [shared]
    comment = Shared
    path = /home/ficovh/mp3
    browseable = yes
    writable = no
    valid users = samba
    

Add a valid user to the NetBSD system: 
    
    # useradd samba
    

Add a windows user to samba and set the password: 
    
    # smbpasswd -a -U samba
    

Now test the server with your Windows machine. 

You can also browse the content from a windows machine with NetBSD smbclient: 
    
    # smbclient //ip_windows/shared_name_resource
    

ip_windows is the IP for the windows machine and shared_name_resource is the directory shared. 

You can also test if your local samba server is working. 
    
    # smbclient -Usamba -L localhost
    

Thats it, a basic samba server on your NetBSD box. 

##  See also 

  * [[How to secure samba with stunnel]]


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb