LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NFS mount through reversed SSH tunnel (https://www.linuxquestions.org/questions/linux-networking-3/nfs-mount-through-reversed-ssh-tunnel-944099/)

ultrauser 05-09-2012 12:34 PM

NFS mount through reversed SSH tunnel
 
Hi guys, I'm having problems mounting a folder via reversed SSH tunnel, the setup is as follows:

nfs server:

rpcinfo -p
Code:

  program vers proto  port
    100000    2  tcp    111  portmapper
    100000    2  udp    111  portmapper
    100024    1  udp  49697  status
    100024    1  tcp  50859  status
    100021    1  udp  56730  nlockmgr
    100021    3  udp  56730  nlockmgr
    100021    4  udp  56730  nlockmgr
    100021    1  tcp  45374  nlockmgr
    100021    3  tcp  45374  nlockmgr
    100021    4  tcp  45374  nlockmgr
    100003    2  tcp  2049  nfs
    100003    3  tcp  2049  nfs
    100003    4  tcp  2049  nfs
    100003    2  udp  2049  nfs
    100003    3  udp  2049  nfs
    100003    4  udp  2049  nfs
    100005    1  udp  57263  mountd
    100005    1  tcp  52592  mountd
    100005    2  udp  57263  mountd
    100005    2  tcp  52592  mountd
    100005    3  udp  57263  mountd
    100005    3  tcp  52592  mountd

tunnel: ssh -c blowfish -R 5100:127.0.0.1:2049 -R 5200:127.0.0.1:52592 nfs_user@nfs_server_ip

exports:
/nfs 127.0.0.1(ro,sync,no_subtree_check)

showmount -e 127.0.0.1
Export list for 127.0.0.1:
/nfs 127.0.0.1

nfs client:

mount -v -t nfs -o tcp,port=5100,mountport=5200 127.0.0.1:/nfs /test

Code:

mount.nfs: timeout set for Wed May  9 22:51:41 2012
mount.nfs: trying text-based options 'tcp,port=5100,mountport=5200,vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'tcp,port=5100,mountport=5200,addr=127.0.0.1'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 127.0.0.1:/nfs

attribute for /nfs is 777

no firewall on both client & server

any ideas?

Thanks in advance :)

EricTRA 05-11-2012 01:05 AM

Hi,

I'm not sure this will work through a reversed SSH tunnel. Have you tried SSHFS? I think it's more adequate in this type of situation. Should be available in repositories for most distros (it is in Debian).

Kind regards,

Eric

ultrauser 05-13-2012 06:24 AM

Is there a way to do a reversed mount with sshfs? problem is that server has dynamic ip, and I dont have access to it.

EricTRA 05-14-2012 12:54 AM

Hi,

Yes, that should be no problem. Set up the reversed SSH tunnel and then connect to the port you use on localhost.
Code:

sshfs -p <port> user@127.0.0.1:/path /localpath
Kind regards,

Eric


All times are GMT -5. The time now is 07:33 AM.