Linux to Linux

Rick Stevens rstevens at vitalstream.com
Tue Mar 8 01:46:23 UTC 2005


brad.mugleston at comcast.net wrote:
> On Mon, 7 Mar 2005, Rick Stevens wrote:
> 
> 
>>As far as sharing files, Linux "speaks" two languages, Samba and NFS
>>(network file system).  You already seem to know about Samba, since
>>you're sharing files between Linux and Windows (which is the hardest
>>bit).
>>
>>A samba server shares its files by specifying those files in a "[label]"
>>stanza in /etc/samba/smb.conf and runs the nmbd and smbd daemons.  I
>>assume you know how to set that up.  Conversely, a samba client simply 
>>mounts shares by use of the "mount -t smbfs" command (or by specifying
>>"smbfs" in the /etc/fstab).
>>
>>Similar stuff is done in NFS.  An NFS server puts the directories it
>>wishes to share in the /etc/exports file (see "man exports").  The
>>server then runs several daemons: portmapper, rpc.lockd, rpc.statd and
>>rpc.nfsd to share those directories out.  Conversely, an NFS client runs 
>>portmapper and mounts the directories via "mount -t nfs" (or specifying
>>"nfs" in the /etc/fstab entry).
>>
>>If you could be a bit more specific in what you want to do, I can help
>>more.
> 
> 
> Thanks, this is a start.  I'll look at the "man exports" printout 
> and see what I can figure out.
> 
> Basically, all I want to do is have access to some directories on 
> thismachine/home/brad when I'm in other parts of the house and 
> to be able to use the printer attached to the other Linux box.
> 
> As far as security it will all be on the same internal network 
> (192.168) and I'm not running a firewall as my LinkSys 
> router/switch has that built in (I hope that's secure - haven't 
> had any problems that I know about).

Peachy.  Essentially, your /etc/exports file on the server would look
like:

	/home/brad	192.168/16(rw,no_root_squash)

To manually start the NFS server code:

	/etc/rc.d/init.d/portmap start
	/etc/rc.d/init.d/nfslock start
	/etc/rc.d/init.d/nfs start

On the client, you'd add lines to your /etc/fstab that look like:

	nfsserver:/home/brad	/mountpoint	nfs	rw 0 0

If you have that in /etc/fstab, the following two commands will start
the NFS client code and automatically mount any NFS volumes it finds
in /etc/fstab:

	/etc/rc.d/init.d/portmap start
	/etc/rc.d/init.d/netfs start

If you don't have any entries in /etc/fstab, mount the stuff via:

	mount -t nfs nfsserver:/home/brad /mountpoint

If you wish to make these permanent (start NFS server processes and
mount them on the NFS client), then you can do the following:

On the server:

	chkconfig --levels 2345 portmap on
	chkconfig --levels 2345 nfslock on
	chkconfig --levels 2345 nfs on

On the client:

	chkconfig --levels 2345 portmap on
	chkconfig --levels 2345 netfs on

Note that this is only for NFS file sharing.  See "man exports" for
details on the /etc/exports file and "man 5 nfs" for the available NFS
options for /etc/fstab and the "mount -t nfs" command.  If you wanted to
do it via Samba, I think you already know how since you apparently share
that stuff with Windows already.  Just think of the Samba shares as
Windows shares.

As to the printer, run the printer manager GUI stuff on the machine
where the printer is attached ("system-config-printer" under FC2/3).
Double click on the printer you want to share, then click on the
"Sharing..." button at the bottom of the "Edit a print queue" box.  Put
a check in the "This queue is available to other computers" and "All
Hosts" should show up in the list of allowed systems.  Click on "OK",
then click on the "Apply" icon in the "Printer Configuration" box to
restart the queues.

Wait a few minutes for the shared queue to get broadcast, then go to the
client machine and bring up its printer manager.  The queue from the
server machine should show up in the "Browsed queues" list.  Just double
click it, select it as the default, set up the queue name and driver and
you should be good to go.

Note that the printer(s) exported from the server will be running the
"IPP" protocol (internet printing protocol, TCP/UDP port 631), should
you need to access them from a machine that doesn't have a GUI or that
can't browse queues on the net.  If you need to access it via a URL,
"ipp://printserver/queuename".  RFC 3510 describes the IPP URL.

Hope your brain doesn't bleed after all that!  :-)
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-      To err is human, to forgive, beyond the scope of the OS       -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list