Dysmey Post > Projects & Stuff > Janovac > Windows File/Print

Windows File/Print

Setting up Samba, which provides file and print services to Windows boxes.

Configuration

Samba is fairly simple: Set up its configuration and then have its services nmb and smb running at bootup.

The problem is the configuration file, smb.conf in the folder /etc/samba. It is very complex with more than enough of its share of directives, more than even Apache. Fortunately I have worked out a configuration file that works on the Janovac and can make its folders visible from the Windows boxes on my network. Here is the Janovac smb.conf, striped of all commented-out commands and most comments. In this page φ is the account's user name and ψ is the password.

[global]
    workgroup = DYSMEY
    server string = Janovac Windows Server
    netbios name = JANOVAC

    log file = /var/log/samba/log.%m
    max log size = 50

    security = user
    passdb backend = tdbsam


;   load printers = yes
    cups options = raw

[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    printable = yes

[web]
    comment = Janovac Web Service
    path = /var/www/html
    writeable = yes
    browseable = yes
    valid users = φ

[common]
    comment = Common Store
    path = /var/common
    writeable = yes
    browseable = yes
    valid users = φ

Make sure that (1) the /var/common folder actually exists; that (2) its user and group is set to φ; that (3) you can read and write to the folder; and (4) your account name and password should be added to the Samba password database.

  1. mkdir /var/common
  2. chown -R φ:φ /var/common
  3. chmod -R ug+rwx /var/common
  4. smbpasswd -a -U φ%ψ

Also make sure there is a workgroup DYSMEY (or whatever name you use for your workgroup) shared with both the Janovac and the Windows boxes.

Post-Configuration

Next you will need to launch the graphical Samba utility by going to System → Administrator → Samba. In the menu bar, under Preferences, choose Samba Users…. Add φ to the list, creating a Samba user with same φ account username and password.

Then launch Firewall (System → Administrator → Firewall) with the root password. Open the Samba ports (137/udp, 138/udp, 139/tcp, and 445/tcp) and press Apply.

Then launch Services (System → Administrator → Services) with the root password, and enable the nmb and smb services.

Finally, launch Terminal, log in as su, and manual start the nmb and smb services with the service utility.


Written by Andy West on 25 November 2009.