AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  NFS+SSH on AIX

    Posted Fri November 18, 2011 04:21 PM

    Originally posted by: SystemAdmin


    Has anyone had some experience tunnelling NFS on AIX through SSH?

    My NFS config seems to work fine, but as soon as I start a tunnel:
    # ssh -i /.ssh/nfs_ssh nfsserver -L 49555:nfsserver:2049 -C -N -f
    and try to connect NFS through it:
    # mount -o vers=4,rw,proto=tcp,port=49555 localhost:/nfsmount/directory /mnt/directory
    It works:
    # nfs4cl showfs

    Server Remote Path fsid Local Path




    localhost /nfsmount/directory 0:171798691847 /mnt/directory

    But the problem is when I browse to the mount point, I cannot do anything with it:
    # ls -l /mnt/directory
    total 0
    # touch /mnt/a/newfile
    touch: 0652-046 Cannot create /mnt/a/newfile

    Any ideas? Anyone out there done SSH forwarding in AIX like this over NFS?

    Thanks!
    #AIX-Forum


  • 2.  Re: NFS+SSH on AIX

    Posted Fri November 18, 2011 06:05 PM

    Originally posted by: SystemAdmin


    i want 4hrs of my life back.

    Solution:
    Since the ssh tunnel initiates the connection between nfsclient and nfsserver first, the mount is being presented to the localhost of the server and not any connecting clients. My access rules were limited to the clients, when it should have only been allowing connections from the server itself.

    SERVER:/etc/exports
    incorrect
    /home/me/sp -rw,access=nfsclient1,vers=4
    correct
    /home/me/sp -rw,access=$HOSTNAME_OF_SERVER,vers=4
    I tried using localhost in place of $HOSTNAME_OF_SERVER, but it only worked with the actual hostname of the server.


    My steps.
    SERVER:/etc/exports
    /home/me/sp -rw,access=$HOSTNAME_OF_SERVER,vers=4
    CLIENT
    $ ssh -i /home/me/.ssh/nfs_ssh $HOSTNAME_OF_SERVER -L 49555:$HOSTNAME_OF_SERVER:2049 -f -C -N
    $ sudo mount -o rw,vers=4,port=49555 localhost:/home/me/sp /mnt/a

    The compression used in this SSH command has doubled the speeds of my NFS transfers. who-raw.

    Feel free to get a hold of me via this thread if you need help.
    #AIX-Forum