Thursday, February 12, 2009

samba server in linux

SAMBA SERVER (SMB):
Samba allows you to share files with Windows PCs on your network, as well as access Windows file and print servers, making your Linux box fit in better with Windows-centric organizations.
In Windows file and printer sharing, SMB is sometimes referred to as CIFS (Common Internet File System), which is an Internet standard network file system definition based on SMB, or NetBIOS, which was the original SMB communication protocol.
Samba is a software package that enables you to share file systems and printers on a network with computers that use the Session Message Block (SMB) protocol. This package is distributed with most Linux flavors but can be obtained from www.samba.org if you do not find it on your distribution. SMB is the protocol that is delivered with Windows operating systems for sharing files and printers. Although you can’t always count on NFS being installed on Windows clients (unless you install it yourself), SMB is always available (with a bit of setup).
The Samba software package contains a variety of daemon processes, administrative tools, user tools, and configuration files. To do basic Samba configuration, start with the Samba Server Configuration window, which provides a graphical interface for configuring the server and setting directories to share.
Most of the Samba configuration you do ends up in the /etc/samba/smb.conffile. If you need to access features that are not available through the Samba Server Configuration window, you can edit /etc/samba/smb.confby hand or use SWAT, a Web-based interface, to configure Samba. Daemon processes consist of smbd (the SMB daemon) and nmbd (the NetBIOS name server). The smbd daemon makes the file-sharing and printing services you add to your Linux system available to Windows client computers.


SAMBA PACKAGE SUPPORT
The Samba package supports the following client computers:
Windows 9x
Windows NT
Windows ME
Windows 2000
Windows XP
Windows for workgroups
MS Client 3.0 for DOS
OS/2
Dave for Macintosh computers
Mac OS X
Samba for Linux
Mac OS X Server ships with Samba, so you can use a Macintosh system as a server. You can then have Macintosh, Windows, or Linux client computers. In addition, Mac OS X ships with both client and server software for Samba.
As for administrative tools for Samba, you have several shell commands at your disposal:testparm and testprns, with which you can check your configuration files; smbstatus, which tells you what computers are currently connected to your shared resources; and the nmblookup command, with which you can query computers.
Samba uses the NetBIOS service to share resources with SMB clients, but the underlying network must be configured for TCP/IP. Although other SMB hosts can use TCP/IP, NetBEUI, and IPX/SPX to transport data, Samba for Linux supports only TCP/IP. Messages are carried between host computers with TCP/IP and are then handled by NetBIOS.

Getting and Installing Samba
You can get Samba software in different ways, depending on your Linux distribution. Here are a few examples:
Debian
To use Samba in Debian, you must install the samba and smbclient packages using apt-get. Then start the Samba service by running the appropriate scripts from the /etc/init.d directory, as follows:
# apt-get install samba samba-common smbclient swat
# /etc/init.d/samba start
# /etc/init.d/smb-client start
Gentoo
With Gentoo, you need to have configured net-fs support into the kernel to use Samba server features. Installing the net-fs package (emergenet-fs) should get the required packages. To start the service, run rc-updateand start the service immediately:

# emerge samba
# rc-update add samba default
# /etc/init.d/samba start

Fedora Core and other Red Hat Linux systems
You need to install the samba, samba-client, samba-common, and optionally, the system-config-samba and samba-swat packages to use Samba in Fedora. You can then start Samba using the serviceand chkconfig commands as follows:

# service smb start
# chkconfig smb on
6) SWAT
The commands and configuration files are the same on most Linux systems using Samba. The Samba project itself comes with a Web-based interface for administering Samba called Samba Web Administration Tool (SWAT). For someone setting up Samba for the first time, SWAT is a good way to get it up and running.

Configuring Samba with SWAT
In addition to offering an extensive interface to Samba options, SWAT also comes with an excellent help facility. And if you need to administer Samba from another computer, SWAT can be configured to be remotely accessible and secured by requiring an administrative login and password.
Before you can use SWAT, you must do some configuration. The first thing you must do is turn on the SWAT service, which is done differently in different Linux distributions.
Here’s how to set up SWAT in Fedora Core and other Red Hat Linux systems:
1. Turn on the SWAT service by typing the following, as root user, from a Terminal window:
# chkconfig swat on

2. Pick up the change to the service by restarting the xinetd startup script as follows:
# service xinetd restart
Linux distributions such as Debian, Slackware, and Gentoo turn on the SWAT service from the inetd superserver daemon. After SWAT is installed, you simply remove the comment character from in front of the swat line in the /etc/inetd.conf file (as root user, using any text editor) and restart the daemon. Here’s an example of what the swatline looks like in Debian:
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
With the SWAT service ready to be activated, restart the inetd daemon so it rereads the inetd.conf file. To do that in Debian, type the following as root user:

# /etc/init.d/inetd restart
The init.dscript and xinetd services are the two ways that SWAT services are generally started in Linux. So if you are using a Linux distribution other than Fedora or Debian, look in the /etc/inetd.conf file or /etc/xinetd.ddirectory (which is used automatically in Fedora), for the location of your SWAT service.
When you have finished this procedure, a daemon process will be listening on your network interfaces for requests to connect to your SWAT service. You can now use the SWAT program to configure Samba.



Starting with SWAT
You can run the SWAT program by typing the following URL in your local browser: http://localhost:901/ Enter the root username and password when the browser prompts you. The SWAT window appears as follows.

No comments:

Post a Comment