Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10055

Sample commands should quote the password value



    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • v20170418
    • Atlas
    • Linux, MacOS, ... all I think.
    • true


      Customer from https://jira.mongodb.org/browse/MMSSUPPORT-14327 suffered serious delay because he copied the sample mongodump+mongorestore command on the Atlas "Seed with mongorestore" page and replaced the password fields with his values, and he got non-intuitive error messages because his passwords had special characters in them and he didn't wrap them inside single quotes. He wants us to update that page to mention the possible need to quote the username/pw/etc, and the mongorestore/mongodump error message should suggest lack of quotes as a possible reason for failed authentication.

      I suggested that the need to use single quotes to prevent special characters (such as $, @, &, ! in strings (such as such as passwords, usernames, database object identifiers etc) from being interpreted is generic feature of Linux and not specific to using mongodump and mongorestore when importing into Atlas, or to MongoDB used from the command line generally. I didn't want this to open the floodgates to revising every manual page where a string is used on the command line.

      He countered by saying that special characters are likely in passwords (and are mandated by the password rules at some sites), and suggested the sample command include the quotes.
      He pointed out that we quote the admin.system.users argument to --nsExclude.

      He went on to suggest it would be even better and probably more secure to store Atlas credentials in a file, like ~/.mongodb/credentials, similar to what AWS does: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html.

      I think replacing -p mySourcePassword with -p 'mySourceP@$$word' and -p atlasPassw0Rd with -p 'atlasP@$$assw0Rd' or similar on that page would be enough, and perhaps consider similar changes on similar pages elsewhere where we have copyable sample commands.




            kay.kim@mongodb.com Kay Kim (Inactive)
            william.byrne@mongodb.com William Byrne III
            Jonathan Dahl Jonathan Dahl
            0 Vote for this issue
            1 Start watching this issue


              5 years, 6 weeks ago