Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do a daily backup of my mongodb server (auth enabled) using the mongodump tool.

mongodump provides two parameters to set the credentials:

-u [ --username ] arg   username
-p [ --password ] arg   password

Unfortunately they don't provide any parameter to read the password from stdin. Therefore everytime I run this command, everyone on the server can read the password (e.g. by using ps aux).

The only workaround I have found is stopping the database and directly accessing the database files using the --dbpath parameter.

Is there any other solution which allows me to backup the mongodb database without stopping the server and without "publishing" my password?

I am using Debian squeeze 6.0.5 amd64 with mongodb 1.4.4-3.

share|improve this question
up vote 2 down vote accepted

Actually, since this request was implemented, the password on the command line is obscured (though there is a caveat about a short window before the obscuring code kicks in). Have you tried specifying an empty string as the password (-p ""), you should then be prompted for a password, which I think is the behavior you are looking for.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.