title: Create an SSH tunnel on the server that needs to access the remote application port
body: <p>I am developing Node.js application. And also new Linux systems. I installed RethinkDB to Google Compute Engine instance. I can access to 28015 driver port locally. But I cannot access to the driver port (28015) so that it cannot be accessed from the outside world. So I did it below commands. But I got some errors.</p>
  
  <pre><code>test@rethinkdbserver:~$ sudo iptables -A INPUT -i eth0 -p tcp --dport 28015 -j DROP
  test@rethinkdbserver:~$ sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 28015 -j ACCEPT
  test@rethinkdbserver:~$ ssh -L 28000:localhost:28015 100.100.63.63
  The authenticity of host '100.100.63.63 (100.100.63.63)' can't be established.
  ECDSA key fingerprint is cc:21:56:de:f1:72:j3:64:50:k4:0b:42:e2:5f:db:63.
  Are you sure you want to continue connecting (yes/no)? yes
  Warning: Permanently added '100.100.63.63' (ECDSA) to the list of known hosts.
  Permission denied (publickey).
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>The authenticity of host '100.100.63.63 (100.100.63.63)' can't be established.
        ECDSA key fingerprint is cc:21:56:de:f1:72:j3:64:50:k4:0b:42:e2:5f:db:63.
        Are you sure you want to continue connecting (yes/no)? yes
        Warning: Permanently added '100.100.63.63' (ECDSA) to the list of known hosts.
        Permission denied (publickey).</p>
  </blockquote>
  
  <p><strong><em>RethinkDB manual document</em></strong></p>
  
  <p>Using SSH tunneling
  First, protect the driver port so that it cannot be accessed from the outside world. On unix-based systems, you can use iptables to block the port as follows:</p>
  
  <pre><code>sudo iptables -A INPUT -i eth0 -p tcp --dport 28015 -j DROP 
  sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 28015 -j ACCEPT
  </code></pre>
  
  <p>Note: You may have to replace eth0 and 28015 above if you are using another interface or not using the default driver port.
  Now create an SSH tunnel on the server that needs to access the remote RethinkDB driver port:</p>
  
  <pre><code>ssh -L &lt;local_port&gt;:localhost:&lt;driver_port&gt; &lt;ip_of_rethinkdb_server&gt;
  </code></pre>
  
  <p>Where,</p>
  
  <blockquote>
    <p>local_port is the port you are going to specify in the driver - It can
    be any available port on your server.</p>
    
    <p>driver_port is the RethinkDB driver port (28015 by default).</p>
    
    <p>ip_of_rethinkdb_server is the IP address of the server that runs the
    RethinkDB server.</p>
  </blockquote>
  
  <p>You can now connect to your RethinkDB instance by connecting to the host localhost and port local_port:</p>
  
  <p>Full document
  <a href="https://rethinkdb.com/docs/security/" rel="nofollow">https://rethinkdb.com/docs/security/</a></p>
  
  <p>Please help</p>