LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-03-2007, 07:19 AM   #1
karlmdv
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware 10
Posts: 14

Rep: Reputation: 0
NFS mount over SSH: Unable to receive; errno = Connection refused


Hi Guys,

I'm trying to mount a directory from my vps box on my local machine. The vps is running Ubuntu feisty, the local machine is Ubuntu edgy.

When I try to mount the share on my local machine I get:
Code:
work@barney:/media# sudo mount repo
mount: RPC: Unable to receive; errno = Connection refused
mount: backgrounding "localhost:/home/repo"
On the face of it, it looks like an nfs process (I'm just learning nfs too so I'm not quite sure which processes are involved in the mount, just that you need some daemons running to act as a client as well as those required for the server) can't see a service from the server.

I've confirmed that both mountd and nfs are visible to the client and are specified properly in the fstab entry:
Code:
work@barney:/etc# cat /etc/fstab | grep repo
localhost:/home/repo /media/repo nfs tcp,rsize=8192,wsize=8192,intr,rw,bg,nosuid,port=61001,mountport=62001,noauto

work@barney:/etc#  ps aux | grep 2049
root      8039  0.0  0.0   4932  1056 ?        Ss   19:27   0:00 ssh -N -f -i repo_key -L 62001:localhost:868 -L 61001:localhost:2049 repo@vpshost

work@barney:/etc# nmap -p 61001,62001 localhost
Starting Nmap 4.20 ( http://insecure.org ) at 2007-07-03 21:25 EST
Interesting ports on localhost (127.0.0.1):
PORT      STATE SERVICE
61001/tcp open  unknown
62001/tcp open  unknown

work@barney:/etc$ sudo rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100021    1   udp  32770  nlockmgr
    100021    3   udp  32770  nlockmgr
    100021    4   udp  32770  nlockmgr
    100021    1   tcp  39210  nlockmgr
    100021    3   tcp  39210  nlockmgr
    100021    4   tcp  39210  nlockmgr
    100024    1   udp   2231  status
    100024    1   tcp   2231  status
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100005    1   udp   2233  mountd
    100005    1   tcp   2233  mountd
    100005    2   udp   2233  mountd
    100005    2   tcp   2233  mountd
    100005    3   udp   2233  mountd
    100005    3   tcp   2233  mountd
RPC info from the vps server. Note: there's no lock manager processes on the vps host because I'm using the user-space nfs server:
Code:
root@vpshost:/etc# rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp   2231  status
    100024    1   tcp   2231  status
    100003    2   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100005    1   udp    865  mountd
    100005    2   udp    865  mountd
    100005    1   tcp    868  mountd
    100005    2   tcp    868  mountd

root@vpshost:/media# cat /etc/exports 
/home/repo      127.0.0.1(rw,root_squash,sync,no_subtree_check,insecure) 0.0.0.0/0(rw,root_squash,sync,no_subtree_check,insecure)
The 0.0.0.0/0 was added to exports in an attempt to 'just get it going'. In that vein both hosts.allow and hosts.deny are empty.

One last thing to note, I'm unable to perform a test mount on the vps host machine (to itself):
Code:
root@vpshost:/media# mount localhost:/home/repo repo
mount: unknown filesystem type 'nfs'
Any suggestions what the problem might be?
 
Old 07-03-2007, 08:11 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,293

Rep: Reputation: 123Reputation: 123
I think the problem is because you're exporting only to localhost.
On workstation, /etc/fstab:
Quote:
localhost:/home/repo /media/repo nfs tcp,rsize=8192,wsize=8192,intr,rw,bg,nosuid,port=61001,mountport=62001,noauto
Replace "localhost" with name or ip of the server.

On server, /etc/exports:
Quote:
/home/repo 127.0.0.1(rw,root_squash,sync,no_subtree_check,insecure) 0.0.0.0/0(rw,root_squash,sync,no_subtree_check,insecure)
You can't specify two on one line.
I suggest you remove the "0.0.0.0...." and change 127.0.0.1 to 0.0.0.0
 
Old 07-03-2007, 04:08 PM   #3
karlmdv
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware 10
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the reply pingu, I've tried various combinations of 127.0.0.1, the ip of the vps, and 0.0.0.0/0 all have had the same result (including each of them on the export line alone)

Quote:
Originally Posted by pingu
On server, /etc/exports:
You can't specify two on one line.
I suggest you remove the "0.0.0.0...." and change 127.0.0.1 to 0.0.0.0
Is this something you've had fail in the past? I believe it's not true as the (5 exports) man page states the opposite:

Quote:
Each line contains an export point and a whitespace-separated list of
clients allowed to mount the file system at that point.
-Karl.
 
Old 07-04-2007, 02:33 AM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,293

Rep: Reputation: 123Reputation: 123
Sorry about that, I read a bit too hasty.
You're right, I now tried it and it exports fine your way.

A little experimentation gives me this:
using 0.0.0.0/0 in /etc/exports renders an error message:
"exportfs: invalid netmask `0' for 0.0.0.0"

With this line in /etc/exports:
"/home/pingu 10.10.10.0/24"
I can mount it fine with a normal mount command,
"mount 10.10.10.2:/home/pingu /mnt/tf"

Thinking of two things:
1) In /etc/exports, you must specify the ip or hostnames etc that are allowed to mount - not the servers ip. Also netmask '0' is not allowed.

2)
Quote:
mount: unknown filesystem type 'nfs'
Is there no support for nfs on the system?
 
Old 07-04-2007, 06:08 AM   #5
karlmdv
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware 10
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pingu
Sorry about that, I read a bit too hasty.
You're right, I now tried it and it exports fine your way.

A little experimentation gives me this:
using 0.0.0.0/0 in /etc/exports renders an error message:
"exportfs: invalid netmask `0' for 0.0.0.0"
How were you able to get this error out of the service? My hope with adding that 'host' to exports was to rule out host-based resrictions being what was stopping me getting this going. I'd like to add the securty measures in once it's working and I've got a better understanding of how it fits together.

I've been playing around with adding some switches to rpc.nfsd & rpc.mountd in /etc/init.d/nfs-user-server in the hope of getting some useful log chat from one of the daemons (like -d auth to get auth failures; no luck on that front there's nothing added to the log when I try and mount). Also the -p switch is supposed to put the service into promiscuous mode where it will servce any host on the network, but doesn't seem to help me.

Quote:
Originally Posted by pingu
With this line in /etc/exports:
"/home/pingu 10.10.10.0/24"
I can mount it fine with a normal mount command,
"mount 10.10.10.2:/home/pingu /mnt/tf"
Same result after adding a /24 address to exports

Quote:
Originally Posted by pingu
Thinking of two things:
1) In /etc/exports, you must specify the ip or hostnames etc that are allowed to mount - not the servers ip. Also netmask '0' is not allowed.

2) Is there no support for nfs on the system?
1) Since the request turns up to the vps host over an ssh forwarded port it will have a source ip of either the local ethernet interface or the loopback address (I think it's the ethernet if, but I'm not certain)

2) I'm wondering if that's the case but I can't find something solid to tell me that's the case, I'm currently working on the assumption I'm just missing something
 
  


Reply

Tags
nfs, ssh, tunneling


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
NFS problem - connection refused from distant host Agrouf Linux - Networking 4 10-17-2005 02:24 PM
mount: RPC: Unable to receive; errno = Connection refused peacho Linux - Networking 1 01-15-2003 02:50 AM
unable to receive incoming connection munisp Linux - Networking 3 11-08-2001 07:08 AM
unable to receive incoming connection munisp Linux - Newbie 3 11-07-2001 12:39 PM
unable to receive incoming connection munisp Linux - General 1 11-07-2001 12:25 PM


All times are GMT -5. The time now is 12:29 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