LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-21-2016, 04:05 PM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Rep: Reputation: Disabled
Access denied by the host (nfs.mount from the Slackware64-current installer)


I am attempting a NFS install of Slackware64-current (up to date as of now) in a VirtualBox VM.

I do "setup 2>ERRORS", in the SOURCE step I choose "Install from NFS", choose the automatic DHCP configuration, check it with "route" in tty2. The gateway is 10.0.2.2 and I can ping it.

Then I input the Slackware source directory as /archives/versions.

The mount command
Code:
mount -r -t nfs -o vers=3 10.0.2.2/archives/versions /var/log/mount
fails and in /ERRORS in the installer I see:
Code:
if addaddress6: Operation not supported # This doesn't hurt, I think.
mount.nfs: access denied by server while mounting 10.0.2.2/archives/versions # This is fatal.
Content of /etc/exports:
Code:
/archives/versions 10.0.2.2(rw,sync,no_root_squash,no_subtree_check)
/etc/hots.deny is empty. Content of /etc/hosts.allow:
Code:
portmap: 10.0.2.2
lockd: 10.0.2.2
rquotd: 10.0.2.2
mountd: 10.0.2.2
statd: 10.0.2.2
Code:
bash-4.2# exportfs
/archives/versions
                10.0.2.2
This just after a reboot, /etc/rc.d/rc.{inet2,rpc,nfs} are executable and ran at startup.

What I am I doing wrong?

Last edited by Didier Spaier; 02-21-2016 at 04:16 PM. Reason: Typo in the title
 
Old 02-21-2016, 04:36 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
Quote:
Originally Posted by Didier Spaier View Post
Content of /etc/exports:
Code:
/archives/versions 10.0.2.2(rw,sync,no_root_squash,no_subtree_check)
You are exporting to only 10.0.2.2 which as I understand is that NFS server machine itself (the gateway?).
Try using a subnet that covers the IP address of your VM.
 
Old 02-21-2016, 04:41 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
You are exporting to only 10.0.2.2 which as I understand is that NFS server machine itself (the gateway?).
Try using a subnet that covers the IP address of your VM.
Yes it is the gateway. How should I write the command to cover the whole subnet? Sorry, I am a pure newbie in networking. The IP address of the VM as reported by "route" in the VM itself is 10.0.2.0.

Last edited by Didier Spaier; 02-21-2016 at 04:43 PM.
 
Old 02-21-2016, 04:52 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You could change it to

Code:
/archives/versions 10.0.2.0/24(rw,sync,no_root_squash,no_subtree_check)
If I remember my subnetting correctly, that would allow anyone under the IP range of 10.0.2.* to have access.

If you want to be more broad, you can just replace that with a wildcard...

Code:
/archives/versions *(rw,sync,no_root_squash,no_subtree_check)
 
Old 02-21-2016, 04:53 PM   #5
MarcT
Member
 
Registered: Jan 2009
Location: UK
Distribution: Slackware 14.2
Posts: 125

Rep: Reputation: 51
You're missing a colon ":" from your mount command. It should be between the hostname/IP address and the exported directory.

Quote:
Originally Posted by Didier Spaier View Post
Code:
mount -r -t nfs -o vers=3 10.0.2.2/archives/versions /var/log/mount
Should be:
Code:
mount -r -t nfs -o vers=3 10.0.2.2:/archives/versions /var/log/mount
M

Last edited by MarcT; 02-21-2016 at 04:54 PM.
 
Old 02-21-2016, 04:57 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
@MarcT: That's a typo, sorry. The command actually includes the colon.
 
Old 02-21-2016, 05:18 PM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
With
Code:
/archives/versions *(rw,sync,no_root_squash,no_subtree_check)
that leads to:
Code:
bash-4.2# exportfs
/archives/versions
                <world>
I get the same error message.
 
Old 02-21-2016, 05:28 PM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
What's the exact error on the server?
 
Old 02-21-2016, 05:33 PM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
What's the exact error on the server?
Code:
Feb 22 00:14:31 ici rpc.mountd[883]: refused mount request from 127.0.0.1 for /archives/versions (/archives/versions): illegal port 45407
PS Google returns nothing obvious... No idea why this port is used either...

PPS 45407 is not listed in /etc/services...

Last edited by Didier Spaier; 02-21-2016 at 05:56 PM.
 
Old 02-21-2016, 06:24 PM   #10
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
Add "insecure" to your mount options in /etc/exports and the error about the illegal port will disappear.
 
1 members found this post helpful.
Old 02-21-2016, 07:09 PM   #11
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 914

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by Didier Spaier View Post
Code:
Feb 22 00:14:31 ici rpc.mountd[883]: refused mount request from 127.0.0.1 for /archives/versions (/archives/versions): illegal port 45407
That mount request shouldn't come from 127.0.0.1 - it should come from 10.0.2.0/24 (if that is what the server is exporting to).

chris
 
Old 02-21-2016, 10:57 PM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
Add "insecure" to your mount options in /etc/exports and the error about the illegal port will disappear.
It worked, thanks Eric!

I still the same error on the client side, but "ls /var/log/mount/" shows the series of packages and I could install the Y series although very slowly (maybe because actually I mounted 10.0.2.2:/archives/versions/slackware64/slackware?). I will continue my investigations later. Still curious why this port is used though. This could be a VirtualBox setting but Google gave me no clue. In VBox.log, I just see the DHCP lease, maybe I can increase the verbosity.
 
Old 02-22-2016, 03:19 AM   #13
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
Well, the NFS daemons assign random ports to incoming connection requests from clients, that is why you see these strange high port numbers.
The SlackDocs wiki contains an article about NFS, and it documents how you can select fixed port numbers for the NFS services, which will make it possible to make holes in a firewall for instance: http://docs.slackware.com/howtos:net...home_nfs_howto

Slow transfers will have nothing to do with the particular directory you mapped, it will be a network related issue.
 
1 members found this post helpful.
Old 02-22-2016, 03:27 AM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
Thanks Eric, I see now. I did read this document and also http://docs.slackware.com/howtos:net...nd_dirty_setup but didn't pay much attention to this part, I have to admit.

Now I will experiment with Samba shares (INSSMB).

I mark this thread as [SOLVED]
 
Old 02-28-2016, 03:20 PM   #15
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Original Poster
Rep: Reputation: Disabled
Post scriptum

I also tried to use a Slackware DVD ISO in an exported NFS directory as package source and confirm that this works as well.

Setting in /etc/exports:
Code:
/archives/images_iso *(rw,sync,insecure,no_root_squash,no_subtree_check)
To do that I made an ISO from an up to today local mirror, named it /archives/images_iso/slackware64-current-install-dvd.iso and used it as virtual DVD in a VM. Then when asked I chose install from NFS, accepted the automatic dhcp connection, provided the IP of the VM's gateway, confirmed the NFS settings, then was told that an ISO image of Slackware install DVD was found and gratefully accepted to have it mounted and used as a package source.

Notes.
  • Do not tell INCISO that the ISO image I used is not a genuine one. That could make it angry
  • Yes, doing that is uselessly convoluted as I could have chosen "install from a Slackware DVD" instead, but that's not the point here.
  • "grep INCISO usr/lib/setup/*" in the initramfs tells me that I could do something similar with the ISO on a hard disk partition or an already mounted directory. I will try that as well just for fun.

Caveat emptor: with this setting the exported directory is writable from anyone anywhere. This is probably not ideal from a security point of view, so enhance it to better secure your data.

Last edited by Didier Spaier; 02-29-2016 at 03:18 AM. Reason: Caveat emptor added.
 
  


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
[SOLVED] mount.nfs: mount(2): Permission denied - only for one host czezz Linux - Server 14 02-26-2015 10:59 AM
NFS Mount from different subnet Access Denied buee Linux - Server 7 12-30-2013 09:56 AM
mount:nfs access denied saigop Linux - Server 5 08-02-2013 08:19 AM
nfs mount returns access denied ahoeffner Linux - Newbie 10 09-04-2011 03:35 AM
NFS mount mount.nfs: access denied by server while mounting knockout_artist Linux - Newbie 2 11-26-2008 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration