[CS-FSLUG] Networking with SuSE

Tim Young Tim.Young at LightSys.org
Thu Feb 2 08:15:01 CST 2006


Hi,
Just to let you know, what you are doing is extremely normal. I.E, 
Having a Unix home shared to another computer is one of the fundamentals 
of unix networking. What you are envisioning is totally standard.

First, the networking layout. For a home network and most small offices, 
you use what is commonly referred as the "star topology." Think of it as 
an asterisk, "*" where the center of the asterisk is the router or 
switch. One of the connections goes outside, and the rest of them go to 
your individual computers.

Internet--*--Computer
/ \
Computer Computer

Your router / gateway / firewall for a home network usually does the 
DHCP, etc.

Then there are three separate issues. Sharing the home directory, 
password synchronization, and application sharing.

This particular situation is what NFS was originally created for. For 
more information, see: (http://www.tldp.org/HOWTO/NFS-HOWTO/index.html) 
Basically, you need to install the nfs server package on the main 
computer where you will have your home directory. The NFS client package 
will already be part of the main OS. You will need to verify that the 
NFS server package is enabled, and started. You will need to edit the 
/etc/exports file on the server computer, and then run "exportfs -v -a" 
from the server.

On the client, you will edit the /etc/fstab file and tell it to use a 
nfs mount for the home partition. Your entry in the /etc/fstab file will 
look something like:
192.168.0.2:/home /home nfs rw,norootsquash 0 0
where 192.168.0.2 is the IP or hostname of the server.

When you share the home partition, you will discover an odd thing about 
Linux. The filesystem tracks the users and groups by numeric ID, rather 
than by username. For example. If on the server, you added a user "Tim" 
and then a user "David." Then on the client, you reversed the order and 
added David first. You will not notice any difference until you mount 
the home partitions. On the first computer, David will have the user ID 
of 501, and on the second computer he has a user ID of 500. When the 
home drive is mounted, suddenly it appears that all David's files are 
owned by Tim, and all Tim's files are owned by David.

Which brings us to the second part, password and account 
synchronization. (see: http://www.tldp.org/HOWTO/NIS-HOWTO/index.html) 
The real "unix" way to do this is through setting up NIS, which 
basically broadcasts the /etc/passwd, /etc/group, /etc/shadow, and other 
files across the network. NIS is actually fairly simple to set up. When 
it is set up, if you change your password on one computer, it is 
immediately reflected on the client also. This is all good and exciting 
for a large network, but for a home network of just two computers, you 
may as well just add your users in the same order on the two computers. 
(as a side note, NIS has been traditionally called "ypbind" and "yp" for 
"Yellow Pages." Due to legal action early on in it's history, the 
outside name is NIS, but everywhere it is referred to as "ypbind." They 
are one and the same package.)

The last issue, with executing one program from the other computer, that 
is what Xwindows is all about. Every xwindows application allows you to 
set an environment variable, "DISPLAY" that tells you where to show the 
program. I will call your two computers, client and server. Let's say 
that you are logged into the client computer and want to execute a 
program on the server. You can telnet to the server, and log in. Then 
you type:
export DISPLAY=client:0
then you run your favorite xwindows application
xeyes
At this time you will find that you get a permissions error.

Xwindows was meant to run in a multi-user environment and therefore a 
lot of security was added to it. You need to allow the server computer 
to write it's window to the client. To do this, on the client you need 
to execute the command:
xhost +server
Then, on the command-line that you have telnetted into the server on, 
you can run xeyes again and you will see the window displayed on the 
client computer.

This whole process is made even simpler if you use ssh to connect 
between the two computers instead of telnet. SSH can have xwindows 
forwarding enabled (in the /etc/ssh/sshd.conf file). When this is the 
case, it is automatic. You ssh from the client to the server, and both 
the display variable and xhost stuff works without your needing to type 
it in.

Anyway, that is the basics of it. Hope this helps.

- Tim Young

David McGlone wrote:

>Hiya all.
>
>I installed SuSE 10 on my desktop today and I would like to share everything 
>between the desktop and laptop which is also running SuSE 10.
>
>Here are a few things I want to accomplish (if possible)
>
>1. I want to be able to run any applications on my desktop from my laptop and 
>vise versa.
>
>2. I want to share the same e-mail. What I mean by this is (if it's possible) 
>when I download my mail using kmail, I want it to be available to both the 
>desktop and laptop. (Picture both computers sharing the same /home directory 
>Hmmm maybe I just answered my own question what do you think?)
>
>3. Will I need to purchase a Hub to accomplish this or can it be accomplished 
>with just my router?
>
>Well thats just about it, basically the goal is to make it feel like my 
>desktop in the other room is on my lap in my living room and vice versa.
>
>David M.
>
>_______________________________________________
>ChristianSource FSLUG mailing list
>Christiansource at ofb.biz
>http://cs.uninetsolutions.com
>
>
>
>  
>




More information about the Christiansource mailing list