LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-27-2005, 09:43 PM   #1
enigma_0Z
Member
 
Registered: Apr 2005
Distribution: Ubuntu, RHEL, Darwin
Posts: 73

Rep: Reputation: 15
Can someone help me get started uisng Unix file sharing?


OK, I believe it's called NFS? I need to create some shared files between computers on a network...

I'd also like to ask another question...

If I've got a computer with a NFS share, can I go to another Unix/Linux/BSD machine and mount that share remotely (eg. over the internet)?
 
Old 05-28-2005, 03:11 AM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
You could start by putting "nfs howto" into google, and following the first link returned. It is not difficult to set up, and will do what you want.
 
Old 05-28-2005, 09:26 AM   #3
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
Re: Can someone help me get started uisng Unix file sharing?

Quote:
Originally posted by enigma_0Z
OK, I believe it's called NFS? I need to create some shared files between computers on a network...
It's easier to do as to explain.
First of all ensure you have NFS support. Ubuntu includes this from the shelf, but in Gentoo you will need to emerge it:
Code:
emerge -avt nfs-utils
There are some more related packages and many howto's tells you how to set them up, but don't bother trying to set this up as the RPC portmapper and
friends are enabled by default.

In Gentoo you will also need to take a glance at the kernel to see if it was build with NFS enabled, it should look like this:
Code:
runlevel0@soviet ~ $ cat /usr/src/linux/.config | grep NFS
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V4=y
CONFIG_NFS_DIRECTIO=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_TCP=y
If this is not so, you will need to rebuild the kernel. Use the handy Genkernel application.

If you are running Ubuntu, ensure first of all that the NFS server is not running:
Code:
/etc/init.d/nfs status
Note that in Ubuntu the above can be called nfsd instead of nfs

Server

Once you are sure every thing is in it's place open your favorite editor (Vim, of course) and create/edit the file /etc/exports
Code:
# /etc/exports: NFS file systems being exported.  See exports(5).
/usr/portage 192.168.0.2(rw,no_root_squash,async) 192.168.0.3(rw,no_root_squash,async)
This is my exported portage tree. The syntax is
Quote:
exported_directory IP_1(options) IP_2(options) ...
On Gentoo if you build the NFS support as a module probe for it and (on both distros) enable NFS at startup or in the default runlevel depending on your preferences.
Code:
modprobe nfs
GENTOO:
rc-update add nfs boot
I don't know how to do this in a Ubuntu specific way, but I'm quite sure it's already enabled.

Now start the NFS daemon:
Code:
/etc/init.d/nfs start
Your NFS server is ready and serving.

Clients

On the client side, the only thing you have to do is putting an entry into /etc/fstab such as this:
Code:
192.168.0.1:/srv/portage  /usr/portage    nfs     noauto,rw,rsize=8192,wsize=8192,nolock,_netdev             0    0
This is the syntax:
Quote:
SERVER_IP:/path /local/path nfs options 0 0
The options:
_netdev tells mount not to try to mount it if the server is not available, this avoids delays at boot time.
nolock avoids exclusive locks, specially important for better performance on networks with more than two machines
noauto this makes that the NFS is not mounted at boot, you need to mount it yourself. You can skip this option if you want.
rsize=8192,wsize=8192 a little tweak which improves performance
rw mount read-write, this is up to you.

Now read the NFS and the mount man pages to get more info and tune your system to your likings.

Quote:

I'd also like to ask another question...
If I've got a computer with a NFS share, can I go to another Unix/Linux/BSD machine and mount that share remotely (eg. over the internet)?
Yes you can. A secure approach is restricting the IP in exports or using an SSH tunnel to use NFS. another way is using iptables to stealth the NFS port 2049. A fast and easy way to do this is using Firestarter and simply enabling this port and the client IP in the "stealthed ports" section.
 
Old 05-31-2005, 11:05 AM   #4
enigma_0Z
Member
 
Registered: Apr 2005
Distribution: Ubuntu, RHEL, Darwin
Posts: 73

Original Poster
Rep: Reputation: 15
How would I use an ssh tunnel? Because I'm probably going to be somewhere where I know my computer's IP but not my laptop's
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unix/Linux Programmer: How do I get started? peaceofcrap2001 Programming 7 06-14-2005 02:24 AM
unix file descriptors versus c FILE pointers nodger Programming 9 11-25-2004 07:02 AM
how to get primary logon network, Access control,File sharing & printer sharing info dileepkk Linux - Networking 2 07-06-2004 06:54 AM
samba sharing from unix. alaios Linux - Networking 0 10-26-2003 12:14 PM
Sharing a windows drive to unix Nelleh Linux - Networking 2 08-22-2002 09:34 AM


All times are GMT -5. The time now is 01:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration