8

How to add username and password to rethinkdb connection?

In my network there are 100 plus machines. Out which only 2 machines are under my control. Out of 2, one is virtual machine and one is physical machine.

If i run rethinkdb on virtual machine with below command

rethinkdb --bind all

Now my rethinkdb http:// ip:8080 is exposed to all machines in the network. How to set username and password to restrict others?

If i use localhost:8080 in the virtual machine, administrative HTTP connection is useless as it can't be accessed neither on the physical machine nor on the virtual machine.

How do i solve this?

Thanks

Ankur
  • 5,086
  • 19
  • 37
  • 62
ekanna
  • 5,462
  • 8
  • 28
  • 31

2 Answers2

15

RethinkDB doesn't provide an authentication system yet, see https://github.com/rethinkdb/rethinkdb/issues/266

The best way for is probably not to start rethinkdb with the --bind all flags.

You can still access the web interface with a ssh tunnel. If you're on linux, the command is

ssh -D <PORT> <LOGIN>@<MACHINE>

Then set up your browser to use the ssh tunnel. In chrome it's in settings > proxy settings Set the socks host to and port to you use before.

Then if you hit machine:8080 in your browser, you should be able to see the adminstration http interface.

neumino
  • 4,342
  • 1
  • 18
  • 17
10

Procedure to create ssh tunnel and access localhost of other machines:

My virtual Machine is linux and my physical Machine is Mac

step1: Access virtual machine and start rethinkdb

user@mac:~# ssh user@linux
user@linux:~# rethinkdb

step2: create a SSH tunnel to access locahost:8080 of linux machine

user@mac:~# ssh -L 9000:localhost:8080 user@linux
user@linux:~#

step3: open a browser and point to

http://localhost:9000

Thats it! You need not change any browser settings!

Resource:

http://www.youtube.com/watch?feature=player_embedded&v=VdkLejEN3So

ekanna
  • 5,462
  • 8
  • 28
  • 31