Samba

 


Contents

  1. Overview
  2. Login Accounts
  3. Start Samba
  4. Configure Samba
  5. Configure WINS
  6. Debugging

 


Overview

Samba provides Windows to UNIX connectivity, basically giving one a Windows Explorer type interface to a UNIX box, allowing one to drag, drop, and edit files on the Linux server using a mapped network drive.

To connect to a Samba share:

  1. Open Windows Explorer
  2. From the Tools menu, select Map Network Drive.
  3. Select a drive letter from the Drive drop-down list.
  4. In the Folder text field, type \\share\name
  5. Click the Finish button.

 


Login Accounts

To use Samba, a user must have both a UNIX and a Samba login/password. To configure a Samba account:

  1. Log in as root

  2. cd /etc/samba

  3. Create the Samba user:

    smbadduser username

    For example:

    [root@Tyr samba]# smbadduser username/username
    ----------------------------------------------------------
    ENTER password for username
    New SMB password:
    Retype new SMB password:
    Added user username.
    

If you want to create samba users from all the current UNIX users, run the following:

cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

To view who is currently logged in, run smbstatus.

 


Start Samba

To start the Samba servers, log in as root and run:

startsmb.sh

 


Kill a Samba Daemon

  1. Log on as root

  2. Run the following to get process ids:

    ps -ef | grep smbd
    ps -ef | grep nmbd

  3. kill each process.

 


Configure Samba

To configure Samba on a UNIX server:

  1. Go to www.samba.org and download a distribution

  2. Transfer the files to the desired UNIX box

  3. Log on to the box as user root

  4. Install by running rpm -i. for example

    rpm -i samba-2.0.10-2.i386.rpm
    rpm -i samba-common-2.0.10-2.i386.rpm

  5. Configure /etc/samba/smb.conf

 


Configure WINS

WINS is a system that provides name resolution and IP addresses for computers on network. WINS uses a distributed database that is automatically updated with the names of computers currently available and the IP address assigned to each one.

DNS is an alternative system for name resolution suitable for network computers with fixed IP addresses.

To register your Samba server with an existing WINS server.

  1. Set the following in /etc/samba/smb.conf:

    wins server = IP_address_of_WINS_server

To enable your Samba server to be a WINS server:

  1. If "wins server" is set in /etc/samba/smb.conf, comment out.

  2. If you are running a Win2K WINS server, turn off in:

    Start | Programs | Services

  3. Set the following in /etc/samba/smb.conf:

    wins support = yes
    wins proxy = yes
    dns proxy = yes

 


Debugging

For excellent debugging info, check out groups.google.com.

If when trying to connect to a share, you get the message...

No service is operating at the destination network endpoint on the remote system

...make sure that your firewall is not blocking access by running

ipchains -F input
ipchains -F output
ipchains -P input ACCEPT
ipchains -P output ACCEPT

If when trying to connect to a share from a Win2K workstation, you get the message...

The account is not authorized to log in from this station
...in smb.conf uncomment the following lines:

encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd


 

Home