remote Mongo server


 

https://ianlondon.github.io/blog/mongodb-auth/

use cool_db

db.createUser({
    user: 'ian',
    pwd: 'secretPassword',
    roles: [{ role: 'readWrite', db:'cool_db'}]
})


sudo vim.tiny /etc/mongod.conf



# network interfaces
net:
  port: 27017
#  bindIp: 127.0.0.1  <- comment out this line





security:
  authorization: 'enabled'


sudo service mongod restart


mongo -u ian -p secretPassword 123.45.67.89/cool_db