TOC PREV NEXT INDEX

LynxOS Networking Guide


Samba

During the initial installation of LynxOS, Samba is installed with the installit utility. Samba can also be configured, installed, or removed at any time after initial installation.

This chapter describes Samba basics and how to configure and run the Samba utilities to connect LynxOS to network clients.

What is Samba?

Samba is server software for computers that run under UNIX or UNIX-like operating systems with standard TCP/IP. The Samba suite is a collection of programs that implements the following protocols for UNIX:

The SMB protocol is sometimes referred to as the Lan Manager or Netbios protocol.

In addition, Samba includes a program, smbclient that implements a simple ftp-like interface that lets users on LynxOS clients access file space and printers on SMB/CIFS servers.

The Samba software is licensed under the GNU Public License. The latest Samba information can be found online at:

http://www.samba.org

Installing/Removing Samba Support

Samba can be installed or removed after initial installation of LynxOS. Install.samba and Uninstall.samba scripts are found in /usr/bin.

Installing Samba

To install Samba, execute the following script:

# Install.samba

The Samba binary distribution is located in /usr/samba. The bin sub-directory contains the Samba executables and script files. The docs sub-directory contains documents and the examples sub-directory contains some sample smb.conf files.

Read the UNIX_INSTALL.txt and DIAGNOSIS.txt files to confirm that the proper prerequisites for the Samba suite are met.

For more information on Samba components, see "LynxOS Samba Components," on the following pages.

Removing Samba

To remove Samba:

# Uninstall.samba

LynxOS Samba Components

The Samba suite includes several components. The following table lists the LynxOS Samba components.

LynxOS Samba Components
Component
Definition
smbd
A daemon that provides the file and print services to SMB clients. The configuration file for this daemon is smb.conf.
nmbd
A daemon that provides Netbios nameserving and browsing support. This daemon can be run interactively to query other name service daemons.
smbclient
A program that implements an ftp-like client.
testparm
A utility that tests the smb.conf configuration file.
smbstatus
A utility that displays the use of the smbd server.

Each Samba component has its own man page. It is recommended that users read the man pages for these components.

Configuring the Samba Server

Samba can be configured to allow connections between LynxOS and Windows clients. LynxOS can behave like a LAN Server, Windows NT Server, or Pathworks machine. Once Samba is installed and configured, directories and printers can be exported to heterogeneous network clients including:

To enable Samba service on the server, perform the following tasks:

Creating and Testing the Samba Configuration File

Use the following procedure to set up and test the Samba server configuration file.

  1. Change to the /usr/samba/lib directory.

# cd /usr/samba/lib
The Samba configuration file must be in this directory.
  1. Create the SMB configuration file, smb.conf.

# vi smb.conf
Sample configuration files can be found in /usr/samba/examples. A simple configuration file is provided below:

Sample smb.conf file
[global]
workgroup = lynuxworks
wins server = server.lynuxworks.com
wins support = no
[tmp]
comment = Temporary file space
path = /tmp
read only = yes
public = yes
[public]
path = /home/share
public = yes
only guest = yes
writable = yes
printable = no

This configuration provides global settings for the Windows workgroup, wins support and allows the client to access the /tmp directory in read-only mode. Additionally, the path /home/share is set up as a read/write directory that anyone can access. The configuration file describes the runtime configuration information for the smbd program. See the smb.conf man page for additional options.
  1. Test the configuration file with the testparm utility:

# /usr/samba/bin/testparm smb.conf
It is important that the validity of smb.conf is tested using the testparm program. If testparm runs without problems, it lists the loaded services. If errors are discovered, testparm returns an error message.

Make sure that the Samba configuration is correct before starting the smbd and nmbd daemons.

Starting the smbd and nmbd Daemons

Start the smbd and nmbd daemons in one of two ways:

In either case, the NETBIOS Name Service and NETBIOS session service ports are monitored for serving any requests. If the Samba daemons are started from the command line, lines must be added to the /net/rc.network file to enable Samba

Starting smbd and nmbd from

Note: smbd and nmbd daemons can be started from the inetd.conf file or the command line. However, using both means of starting the daemons does not work.
inetd.conf

To start smbd and nmbd from inetd, execute the Install.samba script.

Starting smbd and nmbd from the Command Line

To start the smbd and nmbd daemons from the command line, type the following commands:

# /usr/samba/bin/smbd -D
# /usr/samba/bin/nmbd -D

The -D option specifies the command to run as a daemon. For more information on smbd and nmbd, see the respective man pages.

Starting smbd and nmbd from a Script

smbd and nmbd can be started from a script. The advantage is that Samba responds quicker to an initial connection request.

Use the following procedure to start smbd and nmbd from a script.

  1. Create a script to start the smbd and nmbd daemons. A sample startsmb script can be created with these lines:

#!/bin/sh
/usr/samba/bin/smbd -D
/usr/samba/bin/nmbd -D

  1. Make the script executable.

# chmod +x startsmb
The script can be run manually, or it can be executed from /net/rc.network.
  1. To terminate the nmbd and smbd daemons, find them with the ps command and then send a kill signal to the nmbd and smbd daemons.

# ps -ax | grep nmbd smbd
# kill PID

Listing Shares on the Server

Check if the shares (exported services) are available on the server. To do so, run the smbclient program.

The syntax for this command is as follows:

# smbclient -L <hostname>

A list of available shares is returned. If the error message "Bad password" returns, then either an incorrect hosts allow, hosts deny, or valid users line exists in the smb.conf file or the guest account is not valid. Check the guest account with the testparm program and temporarily remove any hosts allow, hosts deny, valid users, or invalid users lines.

If the error message connection refused is returned, then the smbd server might not be running. If the smbd server is initialized from inetd.conf, the line may be malformed. If initialized as a daemon, check that the daemon is running, and that the netbios-ssn port is in a LISTEN state with this command:

# netstat -a

If an error message "session request failed" is returned, then the server refused the connection. If an error returns "your server software is being unfriendly", then it is probably due to an invalid command line parameters set to smbd. Check the configuration file (smb.conf) for syntax errors with testparm and for the existence of the various directories where Samba keeps the log and lock files.

Another common cause of these two errors is if another process is running on port 139, such as Samba. For example, if smbd is running from inetd already or something like Digital's Pathworks is running, an error is returned. Check the inetd.conf file before trying to start smbd as a daemon.



LynuxWorks, Inc.
855 Branham Lane East
San Jose, CA 95138
http://www.lynuxworks.com
1.800.255.5969
TOC PREV NEXT INDEX