Samba and Printing to Widoze

Samba is the tool used for making linux look like a Windows Server in a Windows network. Not only can samba file share, but it can be a logon server, pass passwords to NT domain controlers, and Print. We used RedHat 6.2 With Samba on it to print to a Windows ME machine using an HP970Cse Printer This can also be reversed to allow a windows machine print to a Linux Server.

Sample SMB.conf file:

THE ART OF SAMBA
Samba is an open source software suite that provides seamless file and print services to SMB and
Microsoft clients. Samba is freely available under the GNU General Public License. There is two ways Samba works. First it is a server, secondly it is a client. We will go through the Server Configuration first, and how to connect a Windows 9x computer (Note: Windows 3.1 and Legacy 95 (osr1) DO not work with Samba when it is set to Encrypted.)

=============== Server Setup ==============

Attached is a Configuration file for samba, read through it if you wish to set up your server to take the place of an NT Domain Server (Except for some options).

Your windows box will have to be setup to recognize Samba as a Domain server.
In Network ‘ Client for Microsoft networks -> click logon to NT domain. In the box put in the Domain group.
Also, your IP address must be in the same block to work. Your server cannot be 192.168.0.1, while your clients are 192.168.1.5 or 192.168.1.6, etc.

If your windows box was setup correctly, then you should be able to see the Samba server in Network Neighborhood.

=============== Client Setup ==============

You can use Samba to be a client to another Samba server, or a Windows machine. Here is an example of how to access a windows machine from a Linux Client.

smbclient -L //WINDOWSBOX

Here is an example of what you can get
added interface ip=192.168.1.1 bcast=192.168.1.255 nmask=255.255.255.0
Password:
Sharename               Type               Comment
PRINTER$               Disk                      
HP895CSE               Printer
CDROM                         Disk
C                         Disk
IPC$                         IPC               Remote Inter Process Communication

The most useful way to get access to a Windows box from a Linux box is to mount it:
mount -t smbfs -o uid=USERID,gid=GROUPID //COMPNAME/SHARE /mnt/MNTPT

To mount a Printer, use the REDHAT printer manager to add a SMB printer. Put in the print share and
username, and select the correct Printer Driver. Now you should be able to print in Color / BW to Windows.

This is an example of a WORKING smb.conf file. With minor adjustment, your sever can become an NT Domain server for your windows clients

#============= Global Settings ================
[global]
#Housekeeping things
workgroup = FCDNET
server string = Samba Server
;hosts allow = 192.168.1. 192.168.2. 127.
#Printers
printcap name = /etc/printcap
load printers = yes
;printing = bsd
#Loging
log file = /var/log/samba/log.%m
max log size = 50
#User Sync and Passwords
security = user
password level = 8
username level = 8
encrypt passwords = yes
smb passwd file = /etc/smbpasswd
;     unix password sync = Yes
;     passwd program = /usr/bin/passwd %u
;     passwd chat = *New*UNIX*password* %n *ReType*new*UNIX*password* %n *passwd:*all*authentication*tokens*updated*successfully*
;     username map = /etc/smbusers
#Interface Options
      socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
;         interfaces = 192.168.12.2/24 192.168.13.2/24
#NT Server options (All the server without the NT!)
      local master = yes
      os level = 88
      domain master = yes
      preferred master = yes
      domain logons = yes

# run a specific logon batch file per workstation (machine)
;         logon script = %m.bat
# run a specific logon batch file per username
      logon script = %U.bat
      dns proxy = no

#============== Share Definitions==============
[homes]
      comment = Home Directories
      browseable = no
      writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
[netlogon]
      comment = Network Logon Service
      path = /home/netlogon
      guest ok = yes
      writable = no
      share modes = no

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
      comment = All Printers
      path = /var/spool/samba
      browseable = no
# Set public = yes to allow user ‘guest account’ to print
      guest ok = no
      writable = no
      printable = yes

# A publicly accessible directory,
[web]
      comment = Local Intranet
      path = /www/local
      public = yes
      writable = yes
      printable = no
#(Option: if you want only some people to WRITE to the share, then add:)
      write list = @(Group Name)

[public]
      comment = public server
      path = /public
      public = yes
      writable = yes
      printable = no