Privilege elevation

Also known as: elevated privileges · run as administrator

On this page 7

Privilege elevation is the controlled process by which a user or a running program obtains rights above its normal level, typically administrator or root rights, for a specific task and usually for a limited time. In operating systems, it is the mechanism that lets people work day to day under standard user accounts while still installing software, changing system settings or managing devices when a task genuinely requires it.

The concept is often described as “run as administrator” on Windows or as using sudo on Linux and macOS. Its purpose is to enforce the principle of least privilege: code runs with the minimum rights it needs, and elevated privileges are granted only after an explicit, auditable decision.

How privilege elevation works inside the operating system

Privilege elevation works by replacing or extending the security context under which a process runs. Every process carries an identity, such as an access token on Windows or a set of user and group IDs on Unix-like systems, and the kernel checks that identity on every protected operation, such as writing to a system directory or loading a driver.

On Windows, User Account Control (UAC) gives an administrator two tokens at sign-in: a filtered token with administrative groups disabled and a full token. Programs start with the filtered token, and elevation launches a new process with the full token after a consent prompt or a credential prompt. On Linux, sudo checks a policy file named sudoers, authenticates the user and then runs the command with root’s effective user ID. On macOS, the Authorization Services framework and sudo play similar roles.

A key detail is that elevation normally applies to a new process, not to the process that asked for it. A running program cannot simply raise its own rights; it must start a separate elevated instance or ask a privileged helper service to act on its behalf. This process boundary limits what a compromised program can inherit.

The table below summarizes the main elevation mechanisms on desktop platforms.

MechanismPlatformHow rights are grantedTypical trigger
User Account ControlWindowsFull administrator token for a new processInstaller, “Run as administrator”
sudoLinux, macOS, BSDCommand runs as root under a policy fileCommand prefix in a terminal
suUnix-like systemsFull shell as another user with that passwordSwitching to the root account
pkexec and polkitLinux desktopsAction-specific rules for privileged helpersGraphical settings dialog
Authorization ServicesmacOSRights granted to a privileged helper toolSystem Settings change
Common elevation mechanisms by platform

An elevation request is only trustworthy if the prompt itself cannot be faked or clicked by malware. For that reason, Windows displays UAC prompts on the secure desktop, an isolated desktop that ordinary applications cannot draw on or send input to. This idea is closely related to the secure attention sequence, which guarantees that a sign-in dialog comes from the system rather than from a spoofing program.

Two prompt styles exist. A consent prompt asks an administrator simply to approve the action, while a credential prompt asks a standard user to type the name and password of an administrator account. The second style is stronger, because the person who approves must actually know administrator credentials.

The following table compares the prompt types and their security value.

Prompt typeWho sees itWhat it verifiesRelative strength
Consent promptAdministrator in admin approval modeUser intent onlyModerate
Credential promptStandard userKnowledge of an admin passwordHigh
sudo password promptUser listed in sudoersThe user’s own passwordModerate to high
Silent elevationAdministrator with prompts disabledNothingLow
Elevation prompt types and their strength

Privilege elevation is easily confused with simply being an administrator, but the two are different. Membership in an administrator account group defines what a user may become, while elevation is the moment-by-moment act of actually using those rights. A well-configured system separates the two so that administrative power is dormant until it is deliberately invoked.

ConceptWhat it describesRelationship to elevation
Standard user accountEveryday account without admin rightsMust supply admin credentials to elevate
Administrator accountAccount allowed to manage the systemElevates by consent, rights are dormant by default
SuperuserUnrestricted root identityUsual target identity of elevation on Unix
System accountIdentity used by OS servicesHigher than admin, reached only through services
Privilege escalationUnauthorized gain of rightsAbuse that bypasses legitimate elevation
How elevation relates to neighboring concepts

The last row deserves emphasis. Privilege escalation usually means an attacker exploiting a flaw to gain rights without authorization, whereas privilege elevation is the sanctioned, policy-controlled path. Security teams therefore treat every unexpected elevation as a possible sign of escalation.

Configuring privilege elevation in practice

Good elevation policy aims to make administrative work possible but deliberate. On Windows, this means keeping UAC enabled at its default level or higher and giving most people standard accounts. On Linux, it means granting sudo rights to specific groups, preferring per-command rules over unrestricted access and keeping the sudoers file edited only through visudo, which validates syntax.

Organizations often add just-in-time elevation, in which a user requests administrator rights for a short window, such as 15 to 60 minutes, and the request is logged and sometimes approved by a second person. Privileged access management tools extend this with recorded sessions and automatic removal of rights.

The decision table below shows typical choices.

SituationRecommended approachReason
Home computer used by a familyStandard accounts plus one admin accountChildren and guests cannot install software
Developer workstationAdmin account with UAC or sudo promptsFrequent tooling changes with visible prompts
Corporate desktop fleetStandard users with just-in-time elevationRights are logged and expire automatically
Shared serverPer-command sudo rules for groupsLimits each role to the commands it needs
Kiosk deviceNo elevation path for the session userPublic users must never change the system
Choosing an elevation approach

Limitations, risks and common mistakes

Elevation controls are only as strong as their configuration. Microsoft has stated that UAC is not a security boundary in its default consent mode, because some auto-elevating system programs can be abused to bypass the prompt. A standard account with credential prompts provides much stronger separation than an administrator who merely clicks to consent.

  • Prompt fatigue: users who see frequent prompts learn to approve them without reading, which turns consent into a reflex.
  • Disabling UAC or using passwordless sudo removes the deliberate step and lets any malware running as the user act as administrator.
  • Running a whole session as root or as the built-in Administrator exposes every program, including web browsers, to full system rights.
  • Overly broad sudo rules, such as allowing an editor or a shell as root, give users an easy path to an unrestricted root shell.
  • Missing logging hides who elevated, when and for what, which weakens incident investigation.

The most reliable mitigation is simple: use a standard account for daily work, elevate only for specific administrative tasks and review elevation logs regularly.

The simple explanation

Think of a computer as an office building. Most of the day, you walk around with an ordinary badge that opens your own office and the shared kitchen. Privilege elevation is like going to the front desk to borrow a master key for one job, such as fixing the heating, and then handing it back.

The computer asks you to confirm or type an administrator password before it hands over that key. This small pause protects you, because a harmful program cannot quietly borrow the key on its own. The key point is simple: use high rights only when needed.

How it is used in practice

An accounting firm with 40 Windows laptops gives every employee a standard user account. When an accountant needs to install an updated tax software package, the installer triggers a UAC credential prompt. The employee cannot type an administrator password, so the request goes to the IT technician, who approves a just-in-time elevation window of 30 minutes through the firm’s management tool.

During that window, the installer runs elevated, writes to the program files directory and registers its services. The rights then expire automatically, and the event log records who elevated and which program ran. Months later, a phishing attachment opened on one of the laptops fails to install its persistence component, because it has no administrator rights and no way to elevate silently. The infection stays contained to a single user profile and is cleaned up in under an hour.