I'm trying to find a way to reset default scratch org user's Security Token via CLI. Is that even possible?

  • One way i know generate password for scratch org and then login and do a token reset
    – RedDevil
    Commented Apr 17, 2020 at 11:12
  • Yeah, that's a manual way, I am looking for a script compatible CLI option.
    – VarunC
    Commented Apr 17, 2020 at 11:25

1 Answer 1


Generating a password for the user (force:user:password:generate) should automatically send you an email with the security token. There's no separate command for this in the CLI. You would use the UI if you want to reset the token without resetting the password.

  • I have reset my password using below command but have not received any email with security token. Am I missing something? sfdx force:user:password:generate --targetusername [email protected] Commented Jul 8, 2020 at 12:00
  • @Swetha The token should have been sent by email. Regardless, if you haven't received it, you can manually reset it from the Setup screen.
    – sfdcfox
    Commented Jul 8, 2020 at 13:25
  • @sfdxfox Resetting password via UI (My Username> my settings> Reset password)too does not send me the security token. Commented Jul 8, 2020 at 13:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .