Annotation of wikisrc/tutorials/how_to_set_up_a_samba_server_using_swat.mdwn, revision 1.1
1.1 ! mspo 1: [![SWAT's main menu]]
! 3: : /images/400px-SWAT.jpg
! 4: : /images/SWAT.jpg (SWAT's main menu)
! 6: [!]
! 8: : /images/magnify-clip.png
! 9: : /images/SWAT.jpg (Enlarge)
! 11: SWAT's main menu
! 13: ## Introduction
! 15: 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.
! 17: 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.
! 19: ## Install Samba and enable SWAT
! 21: The first step is to fetch, build and install Samba:
! 23: # cd /usr/pkgsrc/net/samba
! 24: # make install clean
! 27: 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.
! 29: # cp /usr/pkg/share/examples/rc.d/smbd /etc/rc.d/
! 30: # cp /usr/pkg/share/examples/rc.d/nmbd /etc/rc.d/
! 33: You also need to add the following lines to /etc/rc.conf
! 35: smbd=YES
! 36: nmbd=YES
! 39: SWAT can be enabled by adding the following line to /etc/inetd.conf
! 41: swat stream tcp nowait.400 root /usr/pkg/sbin/swat swat
! 44: Now, restart inetd to enable SWAT
! 46: # /etc/rc.d/inetd restart
! 49: ## Use SWAT to configure the Samba server
! 51: 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.
! 53: 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.
! 55: 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.
! 57: 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'.
! 59: 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 <wikimaster@NetBSD.org> software: FreeBSD-CVSweb