Shares

This section discusses:

Sharing filesystems with Microsoft Windows

Samba allows you to make directories available to Windows 95/98/ME/2000/XP clients as native "shares". The Windows clients do not know the shares are running on a Linux machine.

The main difference between a Windows machine serving "shares" and Linux machine serving "shares" is Linux "shares" have better performance than Windows.

samba example


Configuring Samba

To create a "share", first you'll need Samba installed, if it isn't already. You can install Samba from a Red Hat CD or from the Internet. You will need 3 packages:
  1. samba-common
  2. samba
  3. samba-client
You need to download only the Updates (since the updates include the full version). Then install them:
rpm -ivh samba-common-2*rpm
rpm -ivh samba-2*rpm
rpm -ivh samba-client*rpm

You can configure samba through a GUI interface by clicking: Start-->System Settings-->Server Settings-->Samba Server as described in more detail here.

Alternatively, you can configure Samba from a terminal window: The main configuration file for Samba is /etc/samba/smb.conf. Here is a sample:

# /etc/samba.smb.conf
# Global parameters
[global]
        netbios name = SUMMER_SERVER
        server string = Samba Server
        workgroup = WORKGROUP
        security = SHARE
        log file = /var/log/samba/%m.log
        max log size = 0
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        printing = lprng
        encrypt passwords = yes

[pub]
        path = /export/public
        read only = No
        guest ok = Yes
The above creates a [pub] share, which will be in the /export/public directory.
The name of the share (netbios name) is SUMMER_SUMMER. The name of the workgroup(workgroup) is WORKGROUP.

Then start Samba:

/etc/init.d/smb start
Now you're ready to try to access the share from a Windows machine. On your Windows machine, click on Start-->Run and type: \\SUMMER_SERVER\PUB
You should find the files from the Linux server shown there. If not, see the next section.

Some troubleshooting tips

If the share isn't accessible from a Windows machine, you can try to test it from your Linux machine. If your Linux machine's name is summer, you would use smbclient:
smbclient -L summer
It is also helpful to look at the samba log files in /var/log/samba

Many times the problem is the passwords aren't set up right. This describes the situation: Using Samba, Chapter 3. Configuring Windows Clients

A password file Samba can use is: /etc/samba/smbpasswd


Where to get more information

Linux Quick Reference Home
Linux Migration Home