Newer Version Available

This content describes an older version of this product. View Latest

Generate a Password for a Scratch Org

Use the CLI to create a password for your scratch org and set it for the specified username. To change the password after you set it, you can’t unset it, rerun the command.
  1. Generate a password for your scratch org with this command:
    1sfdx force:user:password:generate -u <my-scratch-org>

    You can run this command for scratch orgs only. The command outputs the generated password.

  2. View the scratch org details:
    force:org:display
    1KEY               VALUE
    2───────────────   ─────────────────────────────────────────────────
    3Access Token      008jF!AQoEr5qa2Fp1_.l62DdsQE.ktgDflN_.fVfBc_xQzO3
    4Alias             TempUnmanaged
    5Client Id         SalesforceDevelopmentExperience
    6Created Date      2017-04-26
    7Dev Hub Id        0J746000000PBp9
    8Edition           Developer Edition
    9Expiration Date   2017-05-04
    10Id                00D3D0000008bjF
    11Instance Url      https://connect-ruby-461-dev-ed.cs70.my.salesforce.com
    12Password          4739223f
    13Scratch Org       true
    14Username          scratchorg1493225075521@acme.com
  3. Log in to the scratch org:
    1. From the force:org:display output, copy the value of Instance URL.
    2. Log in:
    3. In the login screen, click Use Custom Domain.
      If you don’t see this option, select Log In with a Different Username.
    4. In the Custom Domain field, paste the instance URL without the https://.
    5. Click Continue, then enter the username and password for the scratch org listed in the output of the org:display command.