Commands with elevated privileges

Some commands in PE require elevated privileges. Depending on the operating system, youc an use either sudo, runas, or a root or admin user.

Elevated privileges allow you to access and do more than you might be able to with your personal account privileges. There are three primary methods for using elevated privileges:

root (or administrator)

In *nix systems, the root user has virtually unlimited access to read, write, or change files and system configurations; install, uninstall, and upgrade software; or perform any operation as any user. The equivalent in Windows is the administrator.

sudo

The sudo command, which means super user do, allows a user to execute a command from a personal user account with temporarily elevated privileges. With sudo, you can do most of the things the root user can do without actually logging in as the root user.

Run as administrator or runas

Using the runas command or running a program as an administrator (for example, by right-clicking the program and selecting Run as administrator) is the Windows equivalent of sudo – It allows you to temporarily perform administrator functions without actually logging in as the administrator.

You can use sudo to run almost all commands in Puppet with the exception of puppet infrastructure commands, which require you to be logged in as the root user (or administrator). You can run puppet infrastructure help <ACTION> to get information about puppet infrastructure commands.

You must log in as the root user (or administrator) to run puppet infrastructure commands.

In Windows systems, use runas or open the command prompt as an administrator (recommended for PowerShell commands) instead of using sudo.