Basic Samba

 

General Overview and Configuration

 

 

 

/etc/rc.d/init.d/smb start

/etc/rc.d/init.d/smb stop

/etc/rc.d/init.d/smb restart

 

 

 

# workgroup = NT-Domain-Name or Workgroup-Name

   workgroup = WORKGROUPNAME

 

# server string is the equivalent of the NT

# Description field

   server string = My UNIX Server

 

 

encrypt passwords = yes

smb passwd file = /etc/smbpasswd

 

 

//COMPUTERNAME/SHARENAME

 

Similar to how you access shares in windows, but you replace backslashes with forward slashes.

 

 

smbadduser username:password

 

 

smbpasswd

 

 

 

Accessing Windows Files via smbmount

 

You can mount a windows share just like you mount a filesystem via NFS.  However, instead of using the mount command, use the smbmount command.  The format is very similar:

 

mount //machinename/share  /local-mount-point

 

Remember, the mount point has to be an empty directory that already exists on your system.

 

For example, if you have a share called “MyHardDrive” on your windows machine called “MyWin98”, and you want to mount it to /mnt/tmp on your UNIX box, you would use:

 

Mount //MyWin98/MyHardDrive /mnt/tmp

 

And the files would be accessible via /mnt/tmp directory on your UNIX machine.

 

 

 

Sharing your UNIX Files with Windows Machines

 

You can share you UNIX files by adding various share directives in your smb.conf file.  The format is like this:

 

[sharename]

   comment = Description of the Share

   path = /directory-to-share

   valid users = username1 username2 username3…

   writable = yes

   printable = no

   create mask = 0764

 

The following entry creates a share called “chrishome”, which shares the UNIX /home/chrisjur directory.  The only users samba users allowed to use this share are chrisjur and root.  Users are allowed write to this share.

 

[development_files]

   comment = This is where our development files live

   path = /home/development_files

   valid users = chrisjur root

   writable = yes

   printable = no

   create mask = 0765

 

 

Sharing your Windows Printers with UNIX Machines

 

The easiest way to setup Windows printers in Linux is to use the printtool in X windows.  The setup is graphical very straightforward.   You need to make sure that your printer is either a postscript printer or that samba includes drives for your printer (valid printers are shown in the printer list box in printtool).