7.3. Registering user accesses
7.3.1. Method A: Doing it all in one operation
To do everything at once, you only need to use the users command. When doing it this way, three things happens:
User account is registered,
New certificate is registered, and
a link between user account and certificate is established.
Lets have a closer look at the eurephiadm command we will use.
user@host:~ $ eurephiadm users --help --add
eurephia::Users -- Administer user accounts
The add user mode registers a new user account.
Both of the following arguments are required:
-u | --username User name to use for the new account (required)
-P | --password Assign a new password via the command line.
To register this new account against a certificate
you can use the following arguments. These arguments cannot be used together.
-C | --certid Use already registered certificate, identified by certid.
-D | --digest Use already registered certificate, identified by digest.
-c | --certfile Use the given certificate file and register it along with
the account.
-2 | --pkcs12 Certificate file is using the PKCS#12 format.
user@host:~ $
If you want to register a completely new user account and a completely new certificate, you will need to have access to the certificate file. If you will be using an already registered certificate, you only need a certificate ID (certid).
7.3.1.1. Register a new user account and a new certificate
To add a new user account and a new certificate and to link them together in one operation, we need to use one of the following command lines. This first example will need a certificate file in PEM/DER format.
user@host:~ $ eurephiadm users --add --username norma.jones --certfile NormaJones.pem
Password for user: ......
Verify password for user: ......
eurephia::Users: User registered successfully (user id 2)
eurephia::Certificates: Certificate registered successfully (certid 2)
user@host:~ $
For PKCS#12 certificates, it is the same arguments. You just need to add --pkcs12. If there is a password on the certificate file it will ask you for that password after the user passwords.
7.3.1.2. Register a new user account with an already registered certificate
In this scenario, we already have the certificate registered and we would just like to link the new account to the already registered certificate. First let's have a look on available certificates:
user@host:~ $ eurephiadm certs --list
ID (D) Common name Organisation
e-mail Registered
Certificate SHA1 digest
------------------------------------------------------------------------------
1 (1) ACME test server. CA certificate ACME corp
ca@acmecorp.com 2009-02-19 22:01:32
39:4F:27:7B:71:7F:1D:BC:B6:1D:65:55:13:0D:E0:CF:5D:38:2E:23
2 (0) Norma Jones Example Corp.
norma.jones@example.com 2009-02-19 22:21:07
C0:5D:7B:2D:4A:98:3F:00:01:02:F0:2F:54:80:3B:5A:FA:53:9B:34
------------------------------------------------------------------------------
user@host:~ $
We see here that certificate ID (certid) 2 is assigned to the common name 'Norma Jones'. Let's give Norma's colleague access when using her certificate as well.
user@host:~ $ eurephiadm users --add --username jane.doe --certid 2
Password for user:
Verify password for user:
eurephia::Users: User registered successfully (user id 3)
user@host:~ $