← All commands
Topic hub Security & Permissions
Windows Linux Security & Permissions Expanded guide System

Windows runas equivalent in Linux

Executes a command with elevated privileges (as root/superuser).

Windows runas
→
Linux equivalents
Debian/Ubuntu same command
sudo
Fedora same command
sudo
Arch same command
sudo

Overview

What this command does

On Windows, "runas" is used to run command as administrator. On Linux, the closest practical mapping shown here is "sudo". Executes a command with elevated privileges (as root/superuser). This reference is grouped under Security & Permissions → System.

Migration tip: <code>sudo</code> stands for <strong>"superuser do"</strong>. It's like Windows UAC — you get elevated permissions for one command. <code>sudo su</code> or <code>sudo -i</code> opens a root shell (use sparingly).

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows runas maps to sudo for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Command-specific caution

Don't stay in a root shell longer than needed. It's easy to accidentally damage your system. Use sudo per-command instead.

Practical tasks

Common use cases

Run command as administrator

Executes a command with elevated privileges (as root/superuser).

sudo command

Run one command as root

sudo -i

Open an interactive root shell

sudo su

Switch to root user

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo apt update
sudo systemctl restart nginx
sudo !!
sudo -i

Walkthrough

Examples with explanations

# Windows: runas /user:Administrator cmd.exe
sudo apt update              # update package list (needs root)
sudo systemctl restart nginx # restart a service

# Forgot sudo? Re-run last command with sudo:
sudo !!                       # very useful shortcut

# Open root shell:
sudo -i                       # root shell (prompt changes to #)

Reference

Common options and variations

Command or optionUse
sudo commandRun one command as root
sudo -iOpen an interactive root shell
sudo suSwitch to root user
sudo !!Re-run last command with sudo
sudo -lList what you're allowed to sudo

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "sudo" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command sudo Same command on this distribution.
Fedora same command sudo Same command on this distribution.
Arch same command sudo Same command on this distribution.

Important

What to watch out for

Don't stay in a root shell longer than needed. It's easy to accidentally damage your system. Use sudo per-command instead.

Keep learning

Related Security & Permissions commands