![]() |
|
||||
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:
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:
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
LynxOS Samba Components
The Samba suite includes several components. The following table lists the LynxOS Samba components.
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:
- Create and test the Samba configuration file.
- Start the smbd and nmbd daemons.
- Listen to the shares on the server.
Creating and Testing the Samba Configuration File
Use the following procedure to set up and test the Samba server configuration file.
Sample configuration files can be found in /usr/samba/examples. A simple configuration file is provided below:
Sample smb.conf file
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.
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
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:
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.
- Create a script to start the smbd and nmbd daemons. A sample startsmb script can be created with these lines:
- 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.
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:
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:
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 |
![]() |
![]() |
![]() |
![]() |