File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_set_up_a_samba_server_using_swat.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Thu Apr 4 23:45:59 2019 UTC (2 years, 9 months ago) by sevan
Branches: MAIN
CVS tags: HEAD
Remove links to missing images

    2: ##  Introduction 
    4: SWAT - the Samba Web Administration Tool provides a really quick and easy way to set up a Samba server, with more powerful configuration options available to those who need them. It's already part of the Samba package that is available from pkgsrc, and you don't even need to install and configure an HTTP server like Apache to use it. 
    6: In this tutorial I will go through the steps I took to set up a share on my NetBSD machine, so that the machine's hard drive could be used for storage by the Windows PC's on the network. The 'guest' account is used for access and I won't go into how to set up users and passwords, so this solution would probably be more suitable for home networks. 
    8: ##  Install Samba and enable SWAT 
   10: The first step is to fetch, build and install Samba: 
   12:      # cd /usr/pkgsrc/net/samba
   13:      # make install clean
   16: Next, put scripts in /etc/rc.d so that smbd and nmbd will be started automatically when NetBSD boots up. I simply used the example scripts that came with NetBSD. 
   18:      # cp /usr/pkg/share/examples/rc.d/smbd /etc/rc.d/
   19:      # cp /usr/pkg/share/examples/rc.d/nmbd /etc/rc.d/
   22: You also need to add the following lines to /etc/rc.conf 
   24:      smbd=YES
   25:      nmbd=YES
   28: SWAT can be enabled by adding the following line to /etc/inetd.conf 
   30:      swat stream tcp nowait.400 root /usr/pkg/sbin/swat swat
   33: Now, restart inetd to enable SWAT 
   35:      # /etc/rc.d/inetd restart
   38: ##  Use SWAT to configure the Samba server 
   40: You should now be able to access SWAT by surfing to **http://<netbsdmachine>:901/** where **<netbsdmachine>** is the IP for your NetBSD machine (or localhost if you are accessing SWAT locally). Login as 'root' with your system's root password. You will be taken to SWAT's main menu. 
   42: First, click on the '**Globals'** icon, and use that menu to configure global options such as the 'workgroup' your Samba server is to be part of. If you don't understand what an option does, click the 'help' link next to it. Use the 'commit changes' button to save your work. 
   44: Next, click on the '**Shares'** icon. To create a share, type a name into the text box and click 'create share'. You will now be able to specify the path to the folder that you want to share. To make the share accessible to anyone on the network without a password, change 'guest ok' to 'yes' using the drop-down menu. Change 'read only' to 'no' if you want other machines on the network to have read/write access to your shared folder. 
   46: Finally click on the '**Status'** icon. From here you can start/stop/restart the Samba server without having to issue any commands at the command line. Just click 'start smbd' and 'start nmbd'. 
   48: Your shared folder should now be accessible by the other machines on the network...To check this out, use 'Network Neighbourhood' in Windows or KDE users can surf to smb:/ in Konqueror... 

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb