---
title: "Configure server access policies"
description: "Set server and account defaults, root and sudo access, token expiry, and execution control for a workspace. Check who can change each setting in Policies."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# Configure server access policies

## Security

**Authentication**, **Server access policies**, and **Sudo access** (part of **Access rules**) are under the top-level Policies menu. Authentication and Server access are shown to Superusers; Access rules is shown to Superusers and to admins who can read approval rules.

The pages under Policies—Authentication, Server access, and Access rules—have no page-wide Save button. A switch, checkbox, or selection saves as soon as you change it, and so does dragging a rule on Access rules. Two changes that weaken a safeguard ask you to confirm first and save only when you do: switching [execution control](#execution-control) to Advisory, and turning on [secrets in command output](#secrets-in-command-output). When you change a number, a line appears below it with the old and new values; click **Save** there or press Enter to save it, or click **Cancel** to put the saved value back. A setting that doesn't save keeps its saved value.

Each page is split into sections. On a wide screen, **Jump to** on the right lists them, most with their current value or count beside them, and selecting one scrolls to it.

These pages ask for MFA when you save a change, never when you open them. You're asked to verify only if your last MFA is older than the workspace's **Sensitive action MFA timeout** (15 minutes unless an administrator changed it). A deployment without Auth0 doesn't ask.

If you haven't registered any of the MFA methods the workspace allows, that verification can't pass, so it doesn't start. A message says you have no available MFA method, and MFA settings opens with the methods the workspace accepts. The change isn't saved. Register one of those methods, close the window to return to the page you were on, and make the change again. The same applies to other changes that ask for MFA this way, such as editing roles.

### Server access policies

> In the app: Policies → Server access (Superuser only, apart from the direct-login sections described below).

Configure server access and security policies for the workspace. On a deployment with Auth0, saving these settings may require a fresh identity verification.

The page also holds the **Direct-login detection**, **Allowed direct access** and **Standing-entry requests**. Those sections are open to the `security_admin` and `admin` roles as well as Superusers, and read-only to `reviewer` and `auditor`; the rest of the page stays Superuser only. See [Turn on detection](/use/audit/governance/external-access/#turn-on-detection) and [The allowed direct access list](/use/audit/governance/external-access/review/#allowed-direct-access).

#### Server defaults

**Allow tunnel by default** setting:

- When enabled, tunnel access is allowed by default for newly registered servers.
- Tunnel sessions provide direct network access to the server.

**Allow code editor by default** setting:

- When enabled, code editor access is allowed by default for newly registered servers.
- Editor sessions provide file editing access on the server.

> Tunnel and editor sessions are not recorded in session monitoring. Review these defaults carefully based on your security requirements.

> Both defaults also apply to newly registered Windows servers. Port forwarding works there with Alpamon 2.5.1 or later, but the code editor can't run on Windows even when it's enabled. See [Windows servers](/reference/platforms/windows/).

**Maximum session duration** setting:

- Limits a work session's duration; defaults to 4 hours.
- Accepts 5–10,080 minutes (5 minutes to 7 days). A Superuser edits it under **Server defaults** on Policies → Server access. Raising the maximum requires the web console.
- Applies to creation and extension requests. An extension's end time must be within this maximum measured from the time the extension is requested. See [Work session time limits](/use/work-sessions/detail/#time-limits).

#### Account defaults

**Home directory access** sets who can enter a member's home directory when IAM user accounts are provisioned to Linux systems. Pick a mode from the list; the row shows which of the owner, the group, and other users can enter.

- `700` **Private**: the owner only
- `750` **Group shared**: the owner and group members
- `755` **Public**: all users

#### sudo and root access

> In the app: **Sudo through Alpacon**, **Sudo outside the web terminal**, and **Ask for MFA again after** sit at the top of the **Using sudo** tab of **Policies > Access rules**. On Alpacon Cloud only a Superuser can change these settings and **Direct root login**. On a self-hosted deployment without Auth0, Staff can change **Direct root login** and turn **Sudo outside the web terminal** on to allow local sudo. They cannot turn it off to block local sudo, and nobody can change **Sudo through Alpacon**.

**Direct root login**:

- Allows direct connection as the root user through system account selection.
- It is off by default.
- When off, the root account is excluded from the system accounts list in Websh, WebFTP, and code editor connections.

**Sudo through Alpacon**:

- Enable [sudo with MFA](/use/work-sessions/terminal/sudo-with-mfa/) to allow Staff and Superuser members to run `sudo` commands in Websh with MFA verification.
- When enabled, the required PAM module is automatically installed on the servers running Alpamon 1.3.2+ that are connected at that moment.
- It works independently from **Direct root login**: users can use `sudo` commands even when direct root access is disabled.
- Turning this setting off stops Alpacon from authorizing `sudo` anywhere in the workspace. **Sudo outside the web terminal** turns on, allowing local sudo, and cannot be changed until **Sudo through Alpacon** is on. The PAM module stays installed. See [Disabling sudo with MFA](/use/work-sessions/terminal/sudo-with-mfa/#disabling-sudo-with-mfa).
- On a deployment that can't ask for MFA (self-hosted without Auth0), the switch is shown but can't be changed, **Ask for MFA again after** isn't shown, and the stored value keeps applying.
- When this setting is on, the **Using sudo** tab shows how many Linux servers can't use **Sudo through Alpacon** because `alpamon-pam` isn't installed. The count includes only enabled, commissioned servers running Alpamon 2.0.2 or later, and appears only when at least one is affected. Click the count to open the filtered server list; the affected servers also show warnings in the list and on their detail pages.

**Ask for MFA again after**:

- Sets how long sudo privileges remain valid after MFA verification.
- After this period expires, the next `sudo` command requires MFA verification again.
- Choose 1, 5, 15, 30, 60, 240, 480, or 1440 minutes. **every time** is also available when this setting uses the sudo timeout or no value is set.

**Sudo outside the web terminal**:

- It is on by default. While on, sudo typed on the server outside Alpacon works according to the account's own sudoers rules.
- Turn it off to block sudo outside the web terminal. Sudo in the web terminal and in `alpacon exec` commands is exempt from this setting.
- This setting is only configurable while **Sudo through Alpacon** is on.
- On a self-hosted deployment without Auth0, it can't be turned off to block local sudo. If it is off, you can turn it on to allow local sudo. While it is off, sudo requires a work session whose sudo policy lets approval take the place of MFA.

#### Secrets in command output

**Expose secrets in audit** sits under **Server defaults** on **Policies** → **Server access policies** and is off by default. Turning it on lets environment variable values passed to a command appear in its output in audit records and the live viewer. It applies when the output is recorded; turning it off later does not remove values already saved. Other detected credentials are still masked.

Turning it on opens a confirmation that describes what becomes visible. Select **I understand**, then click **Turn on exposure**. Turning it off saves at once. Only a Superuser can change this setting, with the sensitive-action MFA check described above.

#### API tokens

Under Policies > Server access, **API tokens** contains **Maximum token lifetime**. Set it to 1–366 days (default 366). It limits the expiry of personal API tokens and server or cluster registration tokens. Creating a token without a date uses this maximum; a later date is refused. Lowering the maximum does not shorten existing tokens. Service tokens and browser sign-ins are outside this limit.

Only a Superuser can change this setting in the console. Saving asks for MFA under the rules above.

#### Standing file execution approvals [#standing-file-execution-approvals]

**Standing approvals** on Policies → Server access holds **Maximum standing approval duration**. Set it to a whole number from 1 to 366 days; the default is 90 days. A new standing file execution approval lasts for at most this many days from approval, and a requester can propose a shorter reuse period but never a longer one. Lowering it does not shorten approvals already granted.

Only a Superuser can change this setting. Saving asks for MFA under the rules above. See [Request a reuse period](/use/work-sessions/commands/file-execution/#request-a-reuse-period) for requests and [Expiry and re-approval](/use/audit/approved-file-executions/#expiry-and-re-approval) for existing grants.

#### Execution control

The **Execution control** section sets one workspace-wide posture: whether Alpacon's judgment of a command **gates** that command, or is only **recorded**.

- **Enforce** (default): assessed risk can hold a command for approval or block it. A Critical judgment blocks execution.
- **Advisory**: assessed risk is recorded without holding or blocking on that judgment. Other access and safety checks still apply.

Advisory is for a workspace that wants the record without the per-command interruption. It applies to the whole workspace—there is no per-server or per-member exception—and you can switch back to **Enforce** at any time.

##### What advisory changes

| Advisory turns off | Advisory keeps on |
| --- | --- |
| Holding a command for approval before it runs | Sign-in, MFA enforcement, and [MFA required actions](/use/policies/authentication/) |
| Blocking a command on its judgment, a **Critical** judgment included | [Roles and permissions](/use/workspace/settings/roles/), and the limits carried by a [service token](/use/iam/applications/service-tokens/) |
| The approval request that a held command would raise | The authority `sudo` needs: a standing permission or a matching [sudo policy](/use/policies/access-rules/) |
| Refusing `sudo` on a command because of its assessed risk | A [work session](/use/work-sessions/)'s servers, features, and expiry, and its [system account rules](/use/work-sessions/account-selection/) |
| Approval of a new [work session](/use/work-sessions/), and of a change to an existing one | [Session recordings](/use/audit/sessions/), [command history](/use/audit/events/commands/), [Privilege elevation](/use/audit/events/sudo/), and the [activity log](/use/audit/governance/activity-log/) |
| | Refusing a command that carries a secret on its command line |

Advisory does not mean every action succeeds. `sudo` still needs authority and the required identity verification. Without standing permission or a matching sudo policy, it is refused immediately with `SUDO_NO_AUTHORITY`; no approval request is created.

##### Who can switch it, and how

Only a **Superuser** can change the mode, and Alpacon asks for a fresh identity verification at the moment of the change—in both directions.

1. Go to Policies → Server access and scroll to **Execution control**.
2. Choose **Advisory**. A confirmation opens listing what the workspace gives up.
3. Select **I understand**, then click **Switch to advisory**. Complete MFA verification if you're asked for it. The mode changes once the save succeeds.

Choosing **Enforce** applies at once. It takes the same role and the same verification, but no confirmation. Either change is recorded in the [activity log](/use/audit/governance/activity-log/) with who made it and when.

  The **Execution control** section only appears where Alpacon can verify your identity at the moment of the change (Alpacon Cloud/Auth0 workspaces). On a deployment that can't, the mode stays at **Enforce** and the section isn't shown.

##### Switching is not retroactive

A change of mode decides what happens next; it doesn't reopen what is already waiting.

- Requests already **Pending** when you switch to advisory stay pending. They are neither approved nor released, and they still need a decision.
- An undecided work session is canceled when its requested end passes or its pending window runs out (24 hours by default), whichever comes first. The requester and assignee, or the assigned token's owner or application recipients, receive an in-app notice.
- To get moving after the switch, submit the request again rather than waiting on the old one. The new request takes the advisory path.

##### What members see

- An amber **Advisory** chip sits beside the workspace name in the top bar, on every page, for every member. Its tooltip says what the posture means, and for Superusers it links to this setting. In **Enforce** there is no chip.
- A command that ran under advisory carries the **Advisory** verification status in [Commands](/use/audit/events/commands/#verification-status).
- A `sudo` action that ran under advisory is recorded in [Privilege elevation](/use/audit/events/sudo/) with the type **Advisory (not gated)**.

Source: https://docs.alpacax.com/use/policies/server-access/
