This is the basic configure for setting up a Samba (Linux file sharing on a windows network) Server. In this case, it is assumed that you are on an NT Domain, and have an NT/2K machine set up as the primary domain controller.

Linux Config
The linux config is done in the file /etc/samba/smb.conf. In previous versions of samba, the file was /etc/smb.conf. The following instructions are starting with a blank smb.conf file. You can remove all the excess information in the standard file.
This all takes place in the [GLOBAL] section (first section) of the file.
  1. Make sure that the file exists first.
  2. Open the file in your favorite text editor.
  3. Make it look like this:
    • [GLOBAL]
    • log file = /var/log/samba/log.%m
    • security = DOMAIN
    • password server = <your NT Domain controller>
    • workgroup = WORKGROUP
    • server string = Samba computer
    • encrypt passwords = yes
    • preferred master = no
    • domain master = no


****NOTE, If you are running Windows XP Home edition, this will not work. XP Home can not logon to a domain. If this is the case, change the line "security = DOMAIN" to say "security = SERVER"
This does not include the information for setting up actual shared folders. For that, see below..

NT server config
This is probably the most simple of all, but must be done. This is only if you have security = DOMAIN. If security = SERVER, I believe that you can skip this step, although I am not sure as I have not tested it.
  1. Click Start -> Programs - Administrative Tools -> Server Manager
  2. Once it opens, click Computer -> Add to domain
  3. In the new window, make sure NT Server or Workstation is marked
  4. Type in the name of the new Linux box that is running samba on it.
  5. Click ok.
  6. End the program.

As I said, very simple, but if you don't remember it, the samba machine will not be able to verify passwords on the network.

File share config
This also takes place in the smb.conf file that you created earlier. This will be after the global settings. We will create a share for everyone to have read/write access to one public directory.
  1. Change to the root directory cd /
  2. Make a directory named public mkdir public
  3. Make the directory read/write/execute by all chmod 777 public
  4. Open the smb.conf file and add this at the end:
    • [public]
    • comment = Public Directory
    • path = /public/
    • public = yes
    • writeable = yes
    • guest ok = yes

Now, for a basic directory where only one person has access to the directory. Place this after the [public] section in smb.conf. We will assume that we want the user lsoule to have access to his home directory. Therefore there must be a directory called /home/lsoule/ on the machine.
  1. [lsoule]
  2. path = /home/lsoule/
  3. valid users = lsoule
  4. writeable = yes


Starting the service
**Note When you make changes to the smb.conf global section, you must restart the smbd and nmbd daemons.
  1. The first time you start this, type smbpasswd -j &ltdomain> -r &ltcomputer>,if the domain is WORGROUP and the PDC is PDC_1, then:
    smbpasswd -j WORKGROUP -r PDC_1
    This is only necessary the first time you start the daemon. If you have a problem, you will need to redo the NT server config. This is if security = DOMAIN not if security = SERVER.
  2. Type /etc/rc.d/init.d/smb status to check the status of the daemons.
  3. Type /etc/rc.d/init.d/smb restart to restart the daemons.


Remember, this is a very basic setup. Once I actually take the time to set up a Samba machine as the PDC, I will post a more complete tutorial, which will also include a lot more of the options that are possible in the file share config (like admin users and printers).