FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: Linux triangle Articles triangle

SAMBA for newbies

By Manas Garg <manas.garg@mailcity.com>
Posted: ( 2000-09-27 13:21:00 EST by Mayank )

Samba is a suite of applications and daemon processes used on *nix
machines primarily for communicating with win* machines for sharing
filespace and printers.

Samba is a suite of applications and daemon processes used on *nix
machines primarily for communicating with win* machines for sharing
filespace and printers. Developed by a Pizza Lover, Andrew Tridgell,
Samba is based upon SMB (Server Message Block) protocol which
describes rules for communication among various machines on a network
(for sharing filespace and printers). If you still don't understand
what SMB protocol is, just launch Network Neighborhood (assuming you
work on windows), and what you see is a live demonstration of SMB
protocol. So, you can call Samba network neighborhood of *nix (As
such, I prefer it the other way round ;-). Samba's flexibility and
functionality are unmatched and it's performance has been a matter of
concern for M$. Apart from sharing filespace and printers, it offers
some more services like.. (I'll be surprised if I have come up with a
complete list ;-)

1. It can act as a Local Browse Master for a Workgroup. Supports
domain logon and logon scripts. Supports browsing on other subnets
and also supports replication of Browse list across subnet
boundaries. (Phew!!)
2. It supports a 'Shared User Database' with all the servers in a
domain sharing a distributed NIS or kerberos authentication
database.
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 filespace
and printers using Samba. Hmmmmm. I think the discussion can be
branched into sharing your filespace and printers with others and
sharing others filespace and printers with yours.

Sharing your filespace and printers with others:

This is accomplished in terms of services (shares in windows). The
concept is simply that your machine offers services to other machines
when it lets them read from/write to your drive or when it lets others
print 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 be
real fun for a creative mind. This is accomplished by the following
components of Samba suite....

smbd
smbd is a daemon process that plays key role in providing
services. It listens to the service requests from other
machines and responds as specified in /etc/smb.conf (got the
importance of this file? ;-)

nmbd
nmbd is a daemon process that understands and replies to
netbios name service requests. Whenever its own name (the
machine it's running on) is specified, it responds with the IP
address of the machine it's running on.

smb.conf
This is the configuration file for Samba. All daemon processes
of Samba suite read this file which makes it extremely
important. I advise you to go through man pages and how-tos
before you sit down to edit this file. If you don't feel like
doing it, I have made an attempt of writing a generic file that
should satisfy your needs. You can use it but the condition is
that you will have to tell me how bad it is so that others find
it a little less bad ;-).

testparm
Once smb.conf is edited to meet your requirements, you have to
check it's validity. Here testparm comes for your rescue!! It
can point out most of the blunders that your smb.conf is likely
to cause.

testprns
This one points out printing related blunders.

Sharing others filespace and printers:

This is accomplished by a host of commands...

smbclient
smbclient lets you inquire about the services a machine offers.
All you have to do is smbclient -L hostname and it lists all
the services of hostname. If you want to browse through a
service, just do smbclient \hostservice. It will give you
an ftp like interface.

smbmount
Call it mapping hostservice on drive U:!! You need to access
some services quite frequently. smbclient is good for quick
browsing but not feasible in such a case. So, here comes
smbmount. It lets you mount hostservice on a directory just
the way you mount any filesystem. Just do smbmount
//host/service /path_to_mount_point and it's done. Access the
files/printers just as they are attached to your machine!!!

smbumount
Well, it's obvious!! You may want to unmount the filesystem
once you are through with your job. Just do smbumount
/path_to_mount_point and ....

nmblookup
It 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 with
a nice GUI for Samba. A pretty good substitute of the above
four 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 commands
which I have not described. Please refer to the documentation that
came with your distro.

"So, you have Network Neighborhood also on Linux!!", they mumbled.
"Yes.", I said and went to work.....;-)

Sample smb.conf
Samba.org
LinNeighborhood

Other articles by Manas Garg

Current Rating: [ 6.69 / 10 ] Number of Times Rated: [ 26 ]

More Articles
* Know Linux
* If I could re-write Linux
* Interview with Mozilla engineering director Chris Hofmann
* Response to SCO's Open Letter
* GNU Linux Security

Contents
Articles
  Howtos
  Interviews
  News
  Opinions
  Reviews
Comparison
Links
  Articles
  Howtos
  Interviews
  Opinions
  Reviews
  Websites
News

Linux
About Linux

Print It!
Printer Friendly Version