Skip to content

How to restore EJBCA CLI user's access? #622

Answered by aloeenmae
aloeenmae asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, seems that my password change works:

python3 -c "import bcrypt; password = 'ejbca'; hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()); print(hashed)"

MariaDB side:

UPDATE UserData SET passwordHash = '$2a$12$MY_NEW_HASH' WHERE username = 'ejbca';
docker exec -i ejbca /opt/keyfactor/ejbca/bin/ejbca.sh roles listadmins --role "Super Administrator Role"
Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: Provided string is not a BCrypt hash.

it seems that EJBCA supports only BCrypt 2a, not 2b, so I replaced $2b with $2a and got the EJBCA CLI working again.

docker exec -i ejbca /opt/keyfactor/ejbca/bin/ejbca.sh roles listadmins --role …

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@aloeenmae
Comment options

@primetomas
Comment options

@aloeenmae
Comment options

@aloeenmae
Comment options

Answer selected by primetomas
@primetomas
Comment options

@aloeenmae
Comment options

@aloeenmae
Comment options

@primetomas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants