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 terminal.
Update the returned string in the password field in the users 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.