Why Linux? How to install programms with rpm Basic knowledges How to create a VCD How to create a Linux web



DOWNload a copy,
upLOAD an idea

Home Linux

Home chiavedisvolta



Impostare una rete Linux

How to create a Linux web Did you have two computers with Linux and you want to share files? The procedure is almost simple, I'll try to explain it in the simplest way. You have to use NFS. Obviously you have to be linked with a web cable and have the IP addresses for the inner web. If we have two computers, one with the 192.168.0.1 address and one with 192.168.0.2. First of all it is necessary to configurate on the server (on the computer on which there are the files you want to share) some files that are in /etc/: the first is

exports

Edit it with

vi /etc/exports

In this file you have to state the folders you want to share and the machine you want to use. If you want to share all the 192.168.0.1's computer home folder with the other pc, you'll add in the exports file this line:

/home/user 192.168.0.2

(rw,no_root_squash)

where user is your username. Within the brackets there are the options managing the permissions. I won't explain here haw they works... in this way I've given reading and writing permission.

Now you have to intervene on the /etc/hosts.allow file and add the lines postmap:192.168.0.2

lockd:192.168.0.2

mountd:192.168.0.2

rquotad:192.168.0.2

statd:192.168.0.2

If you want you can add in the file /etc/hosts.deny the computers you don't want to permitt the access using the same syntax used for hosts.allow.

At this point you have to start the demon nfs. Go in /usr/sbin/ and start the rpc demons (if they're not started). Type then (from the directory /usr/sbin):

rpc.mountd

rpc.statd

rpc.nfsd

rpc.rquotad

rpc.lockd

rpc.idmapd

To know if everything's ok and if the demon is alive or not type:

rpcinfo -p

nfs, mountd, portmapper,status and rquotad should be activated. Then you should be able to mount the 192.168.0.1 home directory on the other computer. Before you have to create (on the client, or 192.168.0.2) a directory on wich mount the first one; if we want to mount it on /mnt/datas/:

mkdir /mnt/datas

Then, from the client too

mount

192.168.0.1:/home/user /mnt/datas

Here you are! If you go in /mnt/datas you will find other computer's home!

Have other problems? I hope not... but it will be possible that launching the order to mount the home directory, the computer answers:

mount to NFS server '192.168.0.1' failed: server is down

It's a bad thing! Probably the firewall blocks the doors opening to NFS (the door is the 111). To verify if this is the problem try to kill iptables typing on the server:

service iptables stop

then try again to launch the mount order to the client. If you don't have error's messages you had identified the problem: iptables...

Now, however, to modify handly iptables is very difficult!

Do you want a simple solution?

Download firestarter, a little programm that set authomaticcally the firewall. Let it run and tell it to permitt the NFS traffic. (the interface is very simple). It works now?