2015-07-03 10 views
8

Ho installato due server s1 e s2. s1 è il server su cui è in esecuzione un server Web mentre s2 è il server su cui è in esecuzione il mio mongodb. Ho impostato l'autenticazione sull'istanza di mongo per sicurezza. Quando provo a connettermi all'istanza di mongo su s2 da s1 ottengo errori quando provo ad autenticarmi.Autenticazione Mongo

Se uso:

mongo DB --host HOST --port PORT -u USER -p PASSWORD 
--authenticationDatabase DB --authenticationMechanism SCRAM-SHA-1 

ottengo questo errore:

Error: 2 SASL authentication support not compiled into client library. 
at src/mongo/shell/db.js:228 
exception: login failed 

Se uso:

mongo DB --host HOST --port PORT -u USER -p PASSWORD 
--authenticationDatabase DB 

ottengo questo errore:

Error: 18 { ok: 0.0, errmsg: "Challenge-response authentication using 
getnonce and authenticate commands is disabled.", code: 2 } at 
src/mongo/shell/db.js:228 
exception: login failed 

se uso:

mongo DB --host HOST --port PORT 

salgo in ma poi ho bisogno di usare db.auth al fine di fare qualsiasi cosa e quindi ottengo questo errore:

Error: 18 { ok: 0.0, errmsg: "Challenge-response authentication using 
getnonce and authenticate commands is disabled.", code: 2 } 

ho idea perché io non posso entrare. Qualcuno può aiutarti?

+0

Quale versione di server mongo stai usando? 3.0.X suppongo? Quindi SCRAM-SHA-1 è attivo per impostazione predefinita e anche il client deve supportarlo. –

risposta

0
  • Avete provato a specificare la porta e il database seguito dall'host? Prova: host mongo: porta/bbdd -u XXX -p

  • Hai abilitato TLS/SSL?

  • Forse Mongo è configurato per accettare solo connessioni da localhost?

saluti

0

Da questo errore:

Error: 2 SASL authentication support not compiled into client library. 

che si adatta anche gli altri errori, penso che la vostra libreria client è compatibile. Confronta le versioni, aggiorna se necessario.