Total Pageviews

Tuesday, 11 February 2014

使用SSH Tunnel管理远程的CouchDB


CouchDB has a very nice web interface (available locally at [http://localhost:5984/utils](http://localhost:5984/utils) ) but this is impossible to use from the command line on a remote server. By default CouchDB only accepts local connections so how do you access this interface from your home computer when the database is on a remote server?
My solution is to setup an ssh tunnel using the following command:
ssh -N -L 9000:localhost:5984 remoteuser@remotehost
This will link port 9000 on the local machine to port 5984 on the remote machine so you will be able to access your remote instance of CouchDB using port 9000 on localhost