Appearance
Locking an Agent to One User
This feature is available on Linux / UNIX agents only.
Why the Agent Normally Runs as Root
Work on an asset (a remote exec, a file transfer, browsing files) runs as the OS account of the person or workflow that requested it, not as Situate (see Identities). To do that, the agent switches to that OS user for each request. Switching to another user requires root, so by default the agent must run as root and refuses to start otherwise:
Situated must run as a privileged userWhat a Locked Agent Does
You can instead lock the agent to a single OS user. A locked agent runs as that user and never switches to anyone else, so it doesn't need root. Use this to:
- Install an agent on a host where you don't have root.
- Limit Situate to one service account on a host.
When an agent is locked:
- Everything runs as the locked user. Tasks, workflow steps, file transfers and file-system operations all run as that user. So do the agent's helper processes, and any agent processes it restarts.
- Only identities for the locked user are accepted. When work needs an OS login, the agent uses only the caller's identity whose login name matches the locked user. The match ignores case. Any other identities the caller has are ignored on this host.
- Situate can do only what the locked user can do. Root-only files, other users' files and privileged commands are out of reach on that host.
- Reboot still requires an admin login. Rebooting the host from Situate still checks that the login is an admin user.
Setting the Locked User
The user must be an existing local account on the host.
To keep the setting across restarts, add it to the agent's config file, /etc/situate.conf (or the file given with the -config option), and restart the agent:
sh
LOCK_USER=<user>To lock the agent for a single run only, start it with:
situated -lockUser <user>The agent can be started as root, in which case it switches to the locked user, or started directly as the locked user.
If the agent can't find the user, it logs the following message and exits:
LOCK_USER <user> not found. Cannot continueIdentities for Users of the Asset
Every user who works with a locked asset needs an identity for the locked user, in an authority the agent accepts. A user who doesn't have one can't run anything on that host that needs an OS login. See Identities for how to add one.
Files the Agent Creates
When locked, the agent:
- Makes the logs directory owned by the locked user.
- Creates a
._<user>directory in the install directory for its shared performance data. - Leaves the ownership of the
securityandsecurity/serversdirectories as they are. An agent that isn't locked makes them owned by root with mode 700.
Asset Attribute
If the agent has an authentication login (AUTHLOGIN) configured, the asset shows a lockedUser attribute of <user>@<auth-login>.