LinuxQuestions.org
Register a domain and help support LQ
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-09-2012, 12:34 PM   #1
ultrauser
LQ Newbie
 
Registered: May 2012
Posts: 2

Rep: Reputation: Disabled
Lightbulb 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

Last edited by ultrauser; 05-09-2012 at 12:36 PM.
 
Old 05-11-2012, 01:05 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
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
 
Old 05-13-2012, 06:24 AM   #3
ultrauser
LQ Newbie
 
Registered: May 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-14-2012, 12:54 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
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
 
  


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
How to mount a nfs, through SSH connection ? frenchn00b Linux - General 8 06-29-2009 10:55 PM
nfs over ssh : mount failed oudoubah Linux - Networking 1 01-08-2007 02:17 AM
SSH tunnel reversed for VNC...Possible? silence Linux - Networking 1 07-22-2004 09:42 AM
Can I mount NFS over the Internet through secure tunnel??? cvega99 Linux - Networking 1 03-10-2003 06:19 AM


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