Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.