4

I have an instance of couchdb running on my local port 5984.

My ultimate goal is to run couchdb on a server within a closed network, and be able to send requests to this server from mobile devices within the network.

This post seems to provide a solution, provided I can open a terminal and make an ssh tunnel:

ssh -f -L localhost:15984:127.0.0.1:5984 user@remote_host -N

But I obviously won't be able to access the command line on mobile devices to make the tunnel. How does one go about accessing applications from mobile devices within closed networks? (I can't just deploy it to some web server as I don't have access to the internet)

David J.
  • 1,753
  • 13
  • 47
  • 96
  • What kind of answer are you looking for here? You haven't told us anything about your mobile app or the network environment that it runs in. Asking how to arrange secure access to your db is a pretty broad topic. – Kenster Jan 08 '18 at 14:29
  • @Kenster Sorry, I didn't know how broad it was. I assumed that being mobile usable and limited to LAN's would reduce the number of feasible answers. I would prefer an answer using free/open-source software. – David J. Jan 08 '18 at 14:39

3 Answers3

1

You can create a SSH tunnel if the client supports port forwarding. Those I know are :

bwt
  • 17,292
  • 1
  • 42
  • 60
1

You CAN run command line on Android, for example with this terminal emulator you can copy a statically linked ssh binary to /data/data/jackpal.androidterm/app_HOME then cd $HOME and ./ssh to execute it

and there are graphical ssh clients, some of which might have the functionality

also termux should have an ssh client available, you probably need to "apt install ssh" when in the app to get it.

jan6
  • 449
  • 2
  • 10
  • FYI both of them have github repos too, but I just think it's easier to get from play store. Also you can cross-compile dropbear for example, if you use the jackpal terminal, termux is the easier option though – jan6 Jan 12 '18 at 11:17
0

You can write a client via sudo apt-cache search libssh; it supports tunneling AKA forwarding.

#include <libssh/libssh.h>

http://api.libssh.org/master/libssh_tutor_forwarding.html

Abdul Ahad
  • 826
  • 8
  • 16