EGR050 - No Local Account for the User
Agent error code #EGR050 indicates that the account the knoc's local account mapping gave for this user does not exist on the agent host. The Knocknoc server maps the user to an account name, from their Knocknoc username or a SAML attribute, and sends it with the grant, and the agent looks that name up on the host: with id on Linux and OpenBSD, and through Windows' own account lookup on Windows. Nothing was found, so there is no account to admit.
The error message names the account the mapping gave.
Common causes include:
- The answer chosen for the identity provider does not match how accounts are named on the host. For example, the whole login gives
[email protected]where the account isalice, which the answer without the domain would give - The user has no account on the bastion yet
- SSSD is configured with fully qualified names, so the account is
[email protected]and the answer should keep the domain - On Windows, the mapping gives
alicefor a domain account that Windows knows asCORP\aliceor[email protected] - Accounts are named by a convention such as
asmithfor[email protected]. The first initial and surname answer gives that, and an account name sent by the identity provider covers any other convention
Steps to Resolve
Compare the Name With the Host
- Note the account named in the error
- On the bastion, try it:
id <that name> - Find the user's real account, for example with
getent passwd | grep -i alice
On Windows, try the name with the lookup in the Windows egress guide's Checking an Account section. net user lists the local accounts.
Fix the Mapping
Open the knoc, choose Edit mapping beside Local account, and type the username into Test a username. Change the answer to the identity provider's question until the preview shows the real account. Where no answer fits, edit the rules under Advanced configuration:
| Knocknoc username | Account on the host | Rule template |
|---|---|---|
alice |
alice |
{username} |
[email protected] |
alice |
{short} |
[email protected] |
[email protected] |
{username} |
CORP\alice |
alice |
{short} |
[email protected] |
CORP\alice (Windows domain account) |
{netbios}\{short} |
[email protected] |
asmith |
a pattern such as ^(?<f>.)[^.]*\.(?<l>[^@]+)@ with {match.f}{match.l} |
To confirm a fix, type the user's username into Test a username in the same dialog and choose Check on host. It asks whether the account the username maps to exists with a uid, or on Windows a RID, of 1000 or higher.
Create the Account
If the user should have an account and does not, create it, or provision it in your directory, then ask the user to request access again.