Skip to content

Instantly share code, notes, and snippets.

@proudlygeek
Last active June 28, 2025 13:28
Show Gist options
  • Save proudlygeek/5721498 to your computer and use it in GitHub Desktop.
Save proudlygeek/5721498 to your computer and use it in GitHub Desktop.

Revisions

  1. proudlygeek revised this gist Jun 6, 2013. 1 changed file with 28 additions and 9 deletions.
    37 changes: 28 additions & 9 deletions nfs-tunnel.md
    Original file line number Diff line number Diff line change
    @@ -1,25 +1,44 @@
    ### 1. Install NFS on Server
    Install the required packages (Ubuntu 12.04):
    apt-get install nfs-kernel-server portmap
    ```bash
    apt-get install nfs-kernel-server portmap
    ```

    ### 2. Share NFS Folder
    Open the exports file:
    vim /etc/exports
    ```bash
    vim /etc/exports
    ```

    Add the following line:
    /home/proudlygeek localhost(insecure,rw,sync,no_subtree_check)
    ```bash
    /home/proudlygeek localhost(insecure,rw,sync,no_subtree_check)
    ```

    Restart NFS Service:
    service nfs-kernel-server restart
    ```bash
    service nfs-kernel-server restart
    ```
    or just export the FS:
    exportfs -a
    ```bash
    exportfs -a
    ```

    ### 3. Install NFS Client
    Install the client:
    apt-get install nfs-common portmap
    ```bash
    apt-get install nfs-common portmap
    ```
    Make a mount folder:
    mkdir /mnt/nfs-share
    ```bash
    mkdir /mnt/nfs-share
    ```
    Setup an SSH tunnel (local-to-remote port):
    ssh -fNv -L 3049:localhost:2049 user@hostname
    ```bash
    ssh -fNv -L 3049:localhost:2049 user@hostname
    ```
    Mount the folder:
    mount -t nfs -o port=3049 localhost:/home/proudlygeek /mnt/nfs-share
    ```bash
    mount -t nfs -o port=3049 localhost:/home/proudlygeek /mnt/nfs-share
    ```

  2. proudlygeek created this gist Jun 6, 2013.
    25 changes: 25 additions & 0 deletions nfs-tunnel.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    ### 1. Install NFS on Server
    Install the required packages (Ubuntu 12.04):
    apt-get install nfs-kernel-server portmap

    ### 2. Share NFS Folder
    Open the exports file:
    vim /etc/exports

    Add the following line:
    /home/proudlygeek localhost(insecure,rw,sync,no_subtree_check)
    Restart NFS Service:
    service nfs-kernel-server restart
    or just export the FS:
    exportfs -a

    ### 3. Install NFS Client
    Install the client:
    apt-get install nfs-common portmap
    Make a mount folder:
    mkdir /mnt/nfs-share
    Setup an SSH tunnel (local-to-remote port):
    ssh -fNv -L 3049:localhost:2049 user@hostname
    Mount the folder:
    mount -t nfs -o port=3049 localhost:/home/proudlygeek /mnt/nfs-share