SUDO for DOS
  • Assembly 95.3%
  • Makefile 4.7%
Find a file
2026-03-17 20:18:35 +01:00
vs6 Include README in VS6 project 2026-03-17 08:58:57 +01:00
.editorconfig Initial import 2026-03-14 11:38:17 +01:00
.gitignore Add VS6 project and instructions 2026-03-16 12:31:40 +01:00
LICENSE.md Include license 2026-03-17 20:18:35 +01:00
Makefile Fix and use ${NASM} 2026-03-14 12:27:07 +01:00
README.md README tweaks 2026-03-17 20:16:48 +01:00
sudo.asm Revert "Zero-terminate tail string" 2026-03-17 19:37:39 +01:00

SUDO for DOS

SUDO command ...

An implementation of sudo for DOS, to run the given command with full privileges.

Examples

Editing important system files:

C:\>sudo edit config.sys

Disk partitioning:

C:\>sudo fdisk

How it works

SUDO examines the environment for the COMSPEC variable to find the default command interpreter, falling back to C:\COMMAND.COM if not set. The interpreter is then executed in unprotected real mode for full privileges.

If a file SUDOERS.SYS is present in the root directory of the boot drive, it is ignored.

Building

Requires NASM:

nasm -f bin -o sudo.com sudo.asm

There is also a Makefile and a Visual Studio 6 project (in vs6/).

Running SUDO directly from the command line will only work on DOS or 32-bit Windows. On modern 64-bit Windows, or other operating systems, you'll need to use something like DOSBox for testing.

Author

By Sijmen J. Mulder ([email protected]). Licensed under the 2-clause BSD license.