ekanna
ekanna

Reputation: 5712

How to add Username and Password to Rethinkdb connection?

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

Upvotes: 8

Views: 3787

Answers (2)

ekanna
ekanna

Reputation: 5712

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

Upvotes: 10

neumino
neumino

Reputation: 4353

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.

Upvotes: 15

Related Questions