Samba as a File Server

This Web page describes the simple steps needed to set up a department file/print server with RedHat/CentOS and Samba. The examples are for CentOS 4. Other Unix flavors run Samba just fine.

Updated 12-July-2006
Samba3 Offical HOW-TO (HTML) · Samba3 HOW-TO (5M PDF)

What you need before starting

Installation

2006 Short Course on Installing CentOS and configuring security and SAMBA

RedHat/CentOS SSH Files for secure remote administration

I can limit the SAMBA server to accept connections from only within UVA but I can log into blue.unix from anywhere in the world and use

ssh -l rtg2t samba.ip.address

to start a terminal session on the SAMBA server and administer the SAMBA server.

SSH is installed by default in CentOS version 4.

Samba Passwords

Read ENCRYPTION.txt to understand how Windows sends password text to a Samba server. Windows has changed its behavior since 1995. Win98's default behavior is different from the original Win95's behavior. Windows2000 and Windows XP can use encrypted passwords right out of the box.

The registry settings for each are listed here: Win95, Win98, W2K, and WinNT.

Test Server

Because Linux is so inexpensive, you can prototype a SAMBA server. Use a machine that is usually a WinTel machine by installing the dual boot software program called GRUB (supercedes LILO). You will be prompted about GRUB during RedHat installation. Install GRUB on the Master Boot Record. Do not fear: GRUB is removed with a simple "sys c:\" command from DOS.

First, use the DOS program FIPS.EXE to split a big C drive (FAT32) into two partitions. FIPS doesn't work on NTFS drives. Add a 2nd 2-4 GB drive when your only drive is NTFS. Install RedHat on the new partition and test away!!

FIPS is in the dosutils directory of the RedHat CDROM. It comes with source code and it is free. Spliting a C drive in two is not reversible. Adding a 2nd drive is reversible.

Show your manager that it will do what it is supposed to do and put it into production!! You can even start with a second-hand pc with no permanent monitor.

References

SMBCLIENT usage

if you only occasionally need access to smb shares from a Linux PC, you may find it more convenient to use smbclient. Smbclient can be used in much the same way as ftp. E.g.:
        $ smbclient //home1/yourid  -U yourid
        smb \> dir *.doc
        smb \> get myfile.doc
        smb \> exit

Multiple Samba Mounts

If you have a Linux workstation and need to make multiple samba mounts from the same samba server, here is an example bash script that will allow you to do them all and only enter your password once:


#!/bin/bash
export PASSWD
read -s -p localPassword:  PASSWD
#
#
smbmount //yourserver/homes s1 -o username=rtg2t,ip=yourserver.virginia.edu
smbmount //yourserver/public s1pub -o username=rtg2t,ip=yourserver.virginia.edu
PASSWD=aaaaaaaa

Multiple Samba Servers

For a workgroup, sometimes it is cost effective to have a main, fast Samba server with lots of RAM and fast SCSI disks and a secondary Samba server that uses a slower PC and big IDE disks.

The secondary Samba server can authenticate users by using the primary Samba server as a fake Primary Domain Controller.

Use these two lines in smb.conf

   security = server
   password server = samba.main.virginia.edu

# where samba.main.virginia.edu is the name of your main,fast samba server

Brief Admin Page

Go here for a quick 1 page summary.