When setting bcrypt hashes via SSH + psql, the $ characters get interpreted by bash at multiple levels.
NEVER try to pass bcrypt hashes directly through nested SSH commands.
Instead, use one of these approaches:
-
Use IEx remote console with
rpccommand (preferred):ssh bastion "ssh server 'sudo -u next /home/next/current/bin/core rpc \" Core.Repo.get_by(Systems.Account.User, email: \\\"user@example.com\\\") |> Systems.Account.User.changeset(%{}) |> Ecto.Changeset.put_change(:hashed_password, \\\"HASH_HERE\\\") |> Core.Repo.update() \"'"
-
Write hash to a file on the server first, then use it in SQL
-
Connect interactively and paste the hash directly
The bcrypt hash format $2b$04$... contains $ which bash interprets as variable expansion, turning it into garbage like bbash4.
When using passwords with ! in bash/curl commands, always use $'...' syntax:
# WRONG - ! causes history expansion issues
curl -d '{"password":"LoadTest123!"}'
# CORRECT - use $'...' syntax
curl -d $'{"password":"LoadTest123!"}'- Assignment ID for load testing: 458
- Service user: loadtest@eyra.service
- SERVICE_LOGIN_KEY: 4q9GgiQw+nB9WDe6vqpUf3a7xLYkGOYCMHWJeq0YzHs=