Whilst initializing a token via softhsm2-util as a non-root user I receive the following error:
$ softhsm2-util --init-token --slot 0 --label "test" --so-pin 5462 --pin 8764329
ERROR: Could not initialize the library.
How can I fix this?
Whilst initializing a token via softhsm2-util as a non-root user I receive the following error:
$ softhsm2-util --init-token --slot 0 --label "test" --so-pin 5462 --pin 8764329
ERROR: Could not initialize the library.
How can I fix this?
Whilst initializing token as a non-root user, we invariably try to access the default
/etc/softhsm/softhsm2.conf
which points tokens to be staged under/var/lib/softhsm/tokens
whose ownership/permission is limited to be used by root and its associated groups.Changing ownership/permission of
/var/lib/softhsm/tokens
doesn't solve the problem as we cannot access/etc/softhsm/softhsm2.conf
in the first place given the access limitation, so we should be doing this instead: