You are not logged in.

#1 2018-05-02 23:18:27

jbenge1
Member
From: Az
Registered: 2018-04-09
Posts: 151

[SOLVED]Attempting to set up NFS server

I can mount my NFS over my local network however I want to be able to access it anywhere I go. I have it running on a little raspberry pi right now, and I am able to connect via ssh from any network at this point. However when trying to mount the NFS from some other network, it gets hung up and does nothing...

running the following commands

sudo mount -t nfs -o vers=4 externalIPAddress:/export/home /run/media/PI-FILES

showmount -e externalIPAddress

both just leave the terminal in a state where I can't do anything in them. Am I mounting them wrong?

Last edited by jbenge1 (2018-05-03 21:04:05)


"Dr. Madden, why don't the natural numbers include 0?" -me
"....... Take a philosophy course" -Dr. Madden

Offline

#2 2018-05-03 09:09:04

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED]Attempting to set up NFS server

I'd ask what your exports look like, but before that i'd say: DO NOT DO THAT.
NFS isn't really meant or safe to be exposed to the internet, use a VPN to tunnel it. (No, neither is SMB)
As alternative, and since you're running ssh (please ensure to use public key authentication, not passwords!) have a look at sshfs, sftp or scp.

Offline

#3 2018-05-03 19:01:22

jbenge1
Member
From: Az
Registered: 2018-04-09
Posts: 151

Re: [SOLVED]Attempting to set up NFS server

I tried sshfs but when I mount it using that I am unable to access the mount

 sudo sshfs justin@externalIpAddress:/home /run/media/PI-FILES/ 

and trying to cd into the dir, I get

bash: cd: pi: Permission denied

"Dr. Madden, why don't the natural numbers include 0?" -me
"....... Take a philosophy course" -Dr. Madden

Offline

#4 2018-05-03 19:06:23

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED]Attempting to set up NFS server

https://wiki.archlinux.org/index.php/SS … leshooting

stat /run/media/PI-FILES/

before and after the mount.

Offline

#5 2018-05-03 19:16:07

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: [SOLVED]Attempting to set up NFS server

I think sshfs shouldn't be mounted as root, but as your user without sudo.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2018-05-03 20:54:20

jbenge1
Member
From: Az
Registered: 2018-04-09
Posts: 151

Re: [SOLVED]Attempting to set up NFS server

before the mount

[justin@zenbook-justin ~]$ stat /run/media/PI-FILES/
  File: /run/media/PI-FILES/
  Size: 40              Blocks: 0          IO Block: 4096   directory
Device: 14h/20d Inode: 39199       Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-05-02 15:57:04.226860616 -0700
Modify: 2018-05-02 11:45:03.422582246 -0700
Change: 2018-05-02 11:45:03.422582246 -0700
 Birth: -

after the mount

[justin@zenbook-justin ~]$ sudo stat /run/media/PI-FILES 
  File: /run/media/PI-FILES
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 2dh/45d Inode: 1           Links: 1
Access: (0777/drwxrwxrwx)  Uid: ( 1001/ UNKNOWN)   Gid: (    4/ UNKNOWN)
Access: 2018-04-17 18:19:51.000000000 -0700
Modify: 2018-05-02 13:06:48.000000000 -0700
Change: 2018-05-02 13:06:48.000000000 -0700
 Birth: -

also I'm not sure if its worth mentioning, but before mounting, the owner/group for the dir is root root and after the mount is 1001 4

drwxrwxrwx  1 1001    4 4096 May  2 13:06 PI-FILES

"Dr. Madden, why don't the natural numbers include 0?" -me
"....... Take a philosophy course" -Dr. Madden

Offline

#7 2018-05-03 21:01:07

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED]Attempting to set up NFS server

You should be able to enter the directory (is it different from the one you mentioned in the error)?

Anyway, please see the posted link and progandy's comment. Mounting sshfs as root should still be possible, but is usually not intended.
Also you might have to align UID/GID.

Offline

Board footer

Powered by FluxBB