While setting up local environments for Drupal 8, everyone may find difficulty in login to the site, if the password is unknown
In Drupal core there is a script file that return the hashed password, which is core/scripts/password-hash.sh.
Run the following command to get the hashed string for '123' in the terminal.
Update the returned string in the password field in the user's table for required users via command line or any MySQL (or any database systems like PostgreSQL, MariaDB, MongoDB) GUI tools.
Hope this helps! Please feel free to get in touch with us if any queries.