Saturday, July 12, 2008

Samba Config

Samba is a suite of applications and daemon processes used on *nixmachines primarily for communicating with win* machines for sharingfilespace and printers.
Samba is a suite of applications and daemon processes used on *nixmachines primarily for communicating with win* machines for sharingfilespace and printers. Developed by a Pizza Lover, Andrew Tridgell,Samba is based upon SMB (Server Message Block) protocol whichdescribes rules for communication among various machines on a network(for sharing filespace and printers). If you still don't understandwhat SMB protocol is, just launch Network Neighborhood (assuming youwork on windows), and what you see is a live demonstration of SMBprotocol. So, you can call Samba network neighborhood of *nix (Assuch, I prefer it the other way round ;-). Samba's flexibility andfunctionality are unmatched and it's performance has been a matter ofconcern for M$. Apart from sharing filespace and printers, it offerssome more services like.. (I'll be surprised if I have come up with acomplete list ;-)
1. It can act as a Local Browse Master for a Workgroup. Supportsdomain logon and logon scripts. Supports browsing on other subnetsand also supports replication of Browse list across subnetboundaries. (Phew!!)2. It supports a 'Shared User Database' with all the servers in adomain sharing a distributed NIS or kerberos authenticationdatabase.3. It can act as a WINS server.4. It supports SMB password encryption scheme.5. It can be turned into a Fax Server.6. It can take backup of PCs directly to a tape.I come back to the focus point of this article now; sharing filespaceand printers using Samba. Hmmmmm. I think the discussion can bebranched into sharing your filespace and printers with others andsharing others filespace and printers with yours.Sharing your filespace and printers with others:This is accomplished in terms of services (shares in windows). Theconcept is simply that your machine offers services to other machineswhen it lets them read from/write to your drive or when it lets othersprint on your printer. Services are created by configuring/etc/smb.conf (In fact, smb.conf is the backbone of Samba Suite).Samba offers so much flexibility in making the services that it can bereal fun for a creative mind. This is accomplished by the followingcomponents of Samba suite....smbdsmbd is a daemon process that plays key role in providingservices. It listens to the service requests from othermachines and responds as specified in /etc/smb.conf (got theimportance of this file? ;-)nmbdnmbd is a daemon process that understands and replies tonetbios name service requests. Whenever its own name (themachine it's running on) is specified, it responds with the IPaddress of the machine it's running on.smb.conf This is the configuration file for Samba. All daemon processesof Samba suite read this file which makes it extremelyimportant. I advise you to go through man pages and how-tosbefore you sit down to edit this file. If you don't feel likedoing it, I have made an attempt of writing a generic file thatshould satisfy your needs. You can use it but the condition isthat you will have to tell me how bad it is so that others findit a little less bad ;-).testparmOnce smb.conf is edited to meet your requirements, you have tocheck it's validity. Here testparm comes for your rescue!! Itcan point out most of the blunders that your smb.conf is likelyto cause.testprnsThis one points out printing related blunders.Sharing others filespace and printers:This is accomplished by a host of commands...smbclientsmbclient lets you inquire about the services a machine offers.All you have to do is smbclient -L hostname and it lists allthe services of hostname. If you want to browse through aservice, just do smbclient \hostservice. It will give youan ftp like interface.smbmountCall it mapping hostservice on drive U:!! You need to accesssome services quite frequently. smbclient is good for quickbrowsing but not feasible in such a case. So, here comessmbmount. It lets you mount hostservice on a directory justthe way you mount any filesystem. Just do smbmount//host/service /path_to_mount_point and it's done. Access thefiles/printers just as they are attached to your machine!!!smbumountWell, it's obvious!! You may want to unmount the filesystemonce you are through with your job. Just do smbumount/path_to_mount_point and ....nmblookupIt finds the IP Address of a machine given it's netbios name(the name by which a machine appears in Network Neighborhood).LinNeighborhood Just don't forget to pick it up. It's a do-all application witha nice GUI for Samba. A pretty good substitute of the abovefour commands if you find command line a little messy!!"What about Network Neighborhood?", They asked.I smiled and launched LinNeighborhood....Besides these, there are a few other, distribution specific commandswhich I have not described. Please refer to the documentation thatcame with your distro."So, you have Network Neighborhood also on Linux!!", they mumbled.
Post a Comment

You might also like :

Related Posts with Thumbnails