Jump to content

file sharing over home network


ChrisM
 Share

Recommended Posts

Not sure if this is the right BB - apologies if I'm in the wrong one.

 

Can anyone point me in the direction of a posting/BB/other so that I can do some reading about setting up some basic filesharing.

 

heres the scenario:

 

3 pcs running mandrake 9.2

1 router/firewall - all pcs have access to internet

1 printer - sharing set up OK.

 

I have created a directory which I want to allow each PC access to the documents. Though I'm not sure how the other pcs gain access to see it, open and read the contents.

 

Using MCC I reated the directory using partition sharing (though I guess this is for multi users on 1 pc?) I've a feeling the considerations I need are related to nfs - which looks awfully complicated and also apparently has security issues - though I've no concerns from users of my home network.

 

I've also looked at Start>Configuration>KDE>Network>File sharing - but this is greyed out.

 

cheers.

 

[moved from Installing Mandrake by spinynorman]

Edited by ChrisM
Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've a feeling the considerations I need are related to nfs - which looks awfully complicated

Yes I think you need NFS, but no man, its not that complicated, for me its far easier than samba. :banana:

 

A quick example:

First, in the computer where the shared folder is located, edit the file /etc/exports and include it there, i.e.:

/shared_folder 192.168.0.0/30(rw)

 

Change 192.168.0.0/30 for your actual network, 'rw' is to give read/write permission, for read only use 'ro' instead. There are many more options, just google a bit or look in the man pages.

 

In the clients computers do:

mount 192.168.0.1:/shared_folder /mnt/shared

 

Thatl mount the folder /shared_folder located in pc 192.168.0.1, to folder /mnt/shared in the local system.

 

If you want to mount the folder automatically at boot, then you have to mess with /etc/fstab, but again, its not that difficult!! man fstab or google, im not at my computer so i cannot give you examples but its quite simple.

 

Thats was all, really quick and simple! :drum:

Link to comment
Share on other sites

hmm and error on your link but no matter the basics are there fore you...

I wrote a simple one the other day too but everything you need is above and it really is dead simple...

 

the gotcha's are file ownership of the exported directory andthe mount point.. if your user couldn't open (execute bit) normally then nfs makes no difference it just follows the same rules

 

 

in fact nfs is transparent... it doesnt differentiate the way it handles network files or local they all become a part of the root tree /

Link to comment
Share on other sites

NFS is not hard to setup, but what's wrong with Samba? It's also pretty easy to setup, and with Webmin it's even easier to setup and manage.

 

samba is just a way to access M$ networks,,,

 

Samba itself is excellent SW but its built on proprietry protocols (CIFS) and its slow as hell ... not to mention pointless between 2 *nix hosts.

 

Its kinda like 2 germans speaking in swahili .. just because they both can doesnt mean its the most efficient way to achieve something..

 

 

p.s. If you installed the default MDK install I can print from your printers!

Link to comment
Share on other sites

NFS is not hard to setup, but what's wrong with Samba? It's also pretty easy to setup, and with Webmin it's even easier to setup and manage.

Yeah I agree with you, nothing wrong with samba at all :P , but even using webmin, whats easier to setup than the couple of files needed for nfs? And for two systems running linux/unix, would you use samba?

Dont take me wrong, I think both are great, but for different purposes. :thumbs:

 

ChrisM:

I forgot to mention that for nfs to work you need to have both 'nfs' and 'rpc' services running on the server and at least 'rpc' on the clients.

Link to comment
Share on other sites

Well, a question is only easy if you know the answer!

 

Gowator, I've fixed that incorrect link in my earlier message ? you contributed to to the thread (I think it might be the one that you refer to).

 

On BOX1 where my shared folder exists I went in to /etc/exports to edit. This is my initial output:

 

/home/username/share *(ro, all_squash, sync)

"/home/username/shared stuff" *(ro, all_squash, synch)

 

I did an edit as follows:

 

/home/username/share *(ro, all_squash, sync)

"/home/username/shared stuff 192.168.0.4 (rw)"

 

Is this correct, or should I have added it an as additional line - I want users to read/write the documents in the directory to be shared, so (rw) is correct in this sense.

 

(though just looking back at feralertx's reply, I have just noted I omitted the "/30" from the ip address ? what significance is this?)

 

Also, I have just been in MCC, looked at 'Set NFS mount points' clicked on search servers and the result was blank/noting. However, in order to set the directory to share, I set this up in MCC from the 'Set up sharing of your hard disk partitions' it asked which protocol to use and I checked nfs, and then allowed all users to share the directory. How come NFS isn't being detected?

 

Think I need to re read through my MDK definitive guide and digest these BBs a little more. I was kinda hoping it would be a straightforward as sharing Internet/printing - please excuse me, I'm still learning my way around.

 

BTW what's RPC ?

 

Cheers.

Edited by ChrisM
Link to comment
Share on other sites

simple answers...

/30 is a mask.. it enables a part of a network class but the way you did it doesnt need this!!!

 

RPC=remote procedure call .. it just means a service wating to be polled...

its automatic with the NFS software, you just need to make sure its installed and the nfs service running...

 

my main nfs server is debian and I know the names of the services but its slightly different in Mandrake... I think its just nfsd or simialr (d=daemon a background service)

 

Just do the easiest one before you refine, i missed the asynch from mine so it gives an error message if I reread the exports but it works... once you have one working you can learn a bit more and trim permissions etc.

 

in the MCC you also have the services you can make sure nfs is started at boot on the server... you can start it manually just by

 

/etc/init.d/nfs start (if its actually called nfs) it couldbe nfsd or simialr but youll see it in the directory anyway...

Link to comment
Share on other sites

I looked in MCC and have server and client both running nfs, netfs and portmap.

 

I presume that I have edited /etc/exports correctly?

 

I have also set my chosen directory to share across all users on the local network and now need to gain access from the client/s:

 

In the clients computers do:

mount 192.168.0.1:/shared_folder /mnt/shared

 

If this next Q comes over as stupid, then slap me! but, where do I put this command - in browser or elsewhere (surely not/etc/exports?), certainly it don't work on browser (Ok, you can stop laughing now :D )

 

Also, what's this I keep coming across about nfs being a security risk? I realise being connected to the internet itself poses a security risk, but I have a router with firewall, which last time I looked showed stealth protection. I presume that I'm only at risk if my firewall is therefore hacked - I've certainly no worries about users on the local network.

 

Cheers and thanks for everything so far.

Link to comment
Share on other sites

you need to open a CLI and su to root

then type exactly :D what you typed above....

(it really is that easy)

if you want you can edit

/etc/fstab and add a line for this... just copy a previous one and change ext3 or whatever to nfs :D and 0 0 as last two no's...

 

if you type

exportfs -ra

it will reread the /etc/exports and reexport - (it will also report errors but not report ifd rpc isn't running - just syntax of the file)

 

you are really really close..don't worry

NFS is a security risk if..

1) you allow root access

2) you don't limit the users like you have done to your subnet...

 

the rest is mainly FUD... and mainly MS centric...

Link to comment
Share on other sites

you need to open a CLI and su to root

then type exactly :D  what you typed above....

(it really is that easy)

 

:cry:

 

after I did su to root and entered my comamnd, I got this back in return

 

shared failed, reason given by server: Permission denied

 

I guess this suggests something is set up right, its the retrieval aspect which is all wrong :wall:

 

Apologies if I'm labouring over this.

Edited by ChrisM
Link to comment
Share on other sites

Apologies if I'm labouring over this.

 

no problem....we are here to help everyone from total noobies to guru's...

 

this would seem to indicate the rpc service is not running on the server...

 

 

did you try

exportfs -ra?

 

if so whats the output...

next check that you have the services actually running now... on the server and check your IP is correct..

 

I usually start off by making the same user the owner of the directory to mount and the exported one.. use

 

ON THE CLIENT

chown you:you /mnt/share (where you = your user name and should be the same group by default in MDK.. try just id in a console as your user to check)

then

 

then just for testing I

chmod 777 /mnt/share

 

 

ON THE SERVER

make sure the same owner owns the exported directory

make sure the directory itself is 777 (for now) as above

reexport using

exportfs -ra (on the server)

and then try and remount on the client...

Link to comment
Share on other sites

Apologies if I'm labouring over this.

 

no problem....we are here to help everyone from total noobies to guru's...

 

this would seem to indicate the rpc service is not running on the server...

 

 

did you try

exportfs -ra?

 

if so whats the output...

next check that you have the services actually running now... on the server and check your IP is correct..

 

 

 

Thank you, this is all very much appreciated.

 

I've answered the first couple of questions for now:

 

Output report of exportfs -ra

 

# exportfs -ra

exportfs: No host name given with /home/username/shared stuff 192.168.0.1 (rw), suggest *(rw) to avoid warning exportfs: /etc/exports [2]: No 'sync' or 'async' option specified for export ":/home/username/shared stuff 192.168.0.1". Assuming default behaviour ('sync'). NOTE: this default has changed from previous versions

 

Ah - in exports edit, I deleted the *(ro,all_squash, sync) and replaces with (rw)

 

Services: on server, portmap,nfs and nfslock are shown as running in MCC on server and client.

 

I've tried running through a couple or so isps without ay success - though my router is showing as server at .0.4 (but as I'm using dhcp - isn't this possible/likely to change anyway - will I need static ip address?

Link to comment
Share on other sites

Ok

I can test the NFS by using showmount command, in my case from the client machine I will enter in Konsole [su] showmount -e <name of server name>

 

# showmount -e 192.168.0.4

 

Export list for 192.168.0.4:

/home/username/share

/home/username/shared stuff 192.168.0.1 *(everyone)

 

but if I want to mount it then this is the result

 

# mkdir /imported

# mount 192.168.0.4:/sharedfiles /imported

mount: 192.168.0.4:/sharedfiles failed, reason given by server: Permission denied

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...