Unanswered
Hi All, Are There Any Alternatives To Storing User Credentials In
- Set hashed passwords with
pass_hashed: true
- Generate passwords using
python3 -c 'import bcrypt,base64; print(base64.b64encode(bcrypt.hashpw("password".encode(), bcrypt.gensalt())))'
(obviously, replace "password" with the actual password). The resulting b64 string should be placed in the password field for each user.
For example, assuming your password is "123456": - bash:
> python3 -c 'import bcrypt,base64; print(base64.b64encode(bcrypt.hashpw("123456".encode(), bcrypt.gensalt())))'
b'JDJiJDEyJDk3OHBFcHFlNEsxTkFoZDlPcGZsbC5sU1pmM3huZ1RpeHc0ay5WUjlzTzN5WE1WRXJrUmhp'
- In
apiserver.conf
:
# A list of fixed users
fixed_users {
enabled: true
pass_hashed: true
users: [
{
username: "john"
password: "JDJiJDEyJDk3OHBFcHFlNEsxTkFoZDlPcGZsbC5sU1pmM3huZ1RpeHc0ay5WUjlzTzN5WE1WRXJrUmhp"
name: "john doe"
}
]
}
74 Views
0
Answers
3 years ago
7 months ago