Results 1 to 2 of 2

Thread: Yet another NFS over SSH problem in 9.10

  1. #1
    Join Date
    Nov 2008
    Americus, GA, USA
    Ubuntu 9.10 Karmic Koala

    Question Yet another NFS over SSH problem in 9.10

    Hi Everybody!

    I'm running the following environment:
    1. Ubuntu Server 9.10, having dynamically assigned DNS record, say (real name is a bit different).
    2. Ubuntu Desktop 9.10, having similar setup and name

    Even though both machines are sitting in the same local network, I'm trying to setup NFS over SSH connectivity. I do realise that tones of different HOWTOs and tutorials are dedicated to such a topic, BUT unfortunately none of them worked for 100% in my case.

    First of all I have created a shared directory in the Server:
    sudo mkdir /share
    sudo chmod 0777 /share
    I have also created similar directory on the Client side:
    sudo mkdir /share
    sudo chmod 0777 /share
    It is assumed that both Server and Client have an account "alien" and both of them have associated pair of RSA keys for easy SSH communication. In particular, both machines have the following files:
    which makes possible running
    ssh -i ~/.ssh/alien
    from the Client, and
    ssh -i ~/.ssh/alien
    from the Server.

    My next step was to install NFS server pakages (portmap nfs-kernel-server) on the Server side, and NFS client packages (portmap nfs-common) on the Client side. In particular
    sudo apt-get install portmap nfs-common
    sudo apt-get install portmap nfs-kernel-server
    Then I have edited /etc/exports on the Server side to include the share:
    where is the network where both Client and Server are working. The following made the Server's share visible to the Client:
    sudo exportfs -ra
    sudo /etc/init.d/portmap restart
    sudo /etc/init.d/nfs-kernel-server restart
    Then, I wanted to set mountd to be bound to a certain port on the Server side as well as nlockmgr. So I did the following on the Server machine:
    1. Edited /etc/default/nfs-kernel-server to include
    2. Edited /etc/modprobe.d/options.conf to include
    options lockd nlm_udpport=2232 nlm_tcpport=2232
    and added lockd to the end of [/etc/modules]
    3. Restarted the Server.

    The above steps resulted in the following output of the rpcinfo -p command on the Server:
       program vers proto   port
        100000    2   tcp    111  portmapper
        100000    2   udp    111  portmapper
        100021    1   udp   2232  nlockmgr
        100021    3   udp   2232  nlockmgr
        100021    4   udp   2232  nlockmgr
        100021    1   tcp   2232  nlockmgr
        100021    3   tcp   2232  nlockmgr
        100021    4   tcp   2232  nlockmgr
        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
    The next step is to create SSH tunnels from Client to Server (commands to be run on Client):
    ssh -i ~/.ssh/alien -L -f sleep 10m
    ssh -i ~/.ssh/alien -L -f sleep 10m
    where parameter 10m at the end of each line specifies that both tunnels will be active for 10 minutes (for the purpuse of experiment).

    Upon creating both tunnels for mountd and nfs we are ready to mount the share (command to be envoked on Client):
    sudo mount localhost:/share /share -o rw,tcp,port=62049,mountport=62233
    This command results in:
    mount.nfs: access denied by server while mounting localhost:/share
    1. There could be some issue originating from the difference in treating localhost and on the Client side;
    2. When I run the same process locally on the Server side and try to connect to its share via SSH tunnels it works... In particular, I did the following on the Server:
    ssh -i ~/.ssh/alien -L -f sleep 10m
    ssh -i ~/.ssh/alien -L -f sleep 10m
    then, I created two local mount points in HOME directory
    mkdir ~/M1
    mkdir ~/M2
    and tried to mount the share in different ways:
    a) Using not forwarded ports:
    sudo mount ~/M1 -o rw,tcp,port=2049,mountport=2233
    resulted in
    mount.nfs: rpc.statd is not running but is required for remote locking.
    mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
    so I changed the command to
    sudo mount ~/M1 -o rw,tcp,port=2049,mountport=2233,nolock
    and it worked!!!
    b) Using forwarded ports:
    sudo mount ~/M2 -o rw,tcp,port=62049,mountport=62233,nolock
    resulted in no response (console went blocked)

    PLEASE HELP... I checked so many resources and nothing helped...

  2. #2
    Join Date
    Jan 2010

    Re: Yet another NFS over SSH problem in 9.10

    Hi, I may not have any answers, but I was wondering why you don't have any info on the status port. I too am looking to install iptable rules for nfs and am stuck as well.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts