In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, e ...
,
runas
(a compound word, from “run as”) is a
command
Command may refer to:
Computing
* Command (computing), a statement in a computer language
* COMMAND.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on Apple Macintosh computer keyboards
* ...
in the
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
line of
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s that allows a user to run specific tools and programs under a different
username
A user is a person who utilizes a computer or Computer network, network Service (systems architecture), service.
A user often has a user account and is identified to the system by a username (or user name). Other terms for username includ ...
to the one that was used to
logon to a computer interactively. It is similar to the
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
commands
sudo
sudo ( or ) is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do", as that was all it did, and it i ...
and
su
, but the Unix commands generally require prior configuration by the system administrator to work for a particular user and/or command.
Microsoft Windows
The
runas
command was introduced with the
Windows 2000
Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It was the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RTM), releas ...
operating system. Any application can use this API to create a
process
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
*Business process, activities that produce a specific se ...
with alternate credentials, for example,
Windows Explorer
File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file ...
in
Windows 7
Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on July 22, 2009, and became generally available on October 22, 2009. It is the successor to Windows Vista, released nearly ...
allows an application to be started under a different account if the shift key is held while right-clicking its
icon
An icon () is a religious work of art, most commonly a painting, in the cultures of the Eastern Orthodox, Oriental Orthodox, and Catholic churches. They are not simply artworks; "an icon is a sacred image used in religious devotion". The most ...
. The program has the ability to cache verified credentials so that the user only ever has to enter them once.
Syntax
The command-
syntax
In linguistics, syntax () is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure ( constituency) ...
is:
runas [] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel:] [/savecred] /user: program
Parameters
This section is paraphrased from the
runas /?
command.
*
/noprofile
: Speeds up the loading of the application by skipping the loading of the user's profile. ''Note that this might not speed up every application.''
*
/profile
: Do not skip loading the user's profile. ''This is the default setting.''
*
/env
: Use the actual environment, not the user's.
*
/netonly
: Specifies that the given credentials are to be used for Remote access only.
*
/savecred
: Credentials saved by the previous user. ''This setting is not available on Windows 7 Home or Windows 7 Starter Edition. This setting is left out from Windows XP Home Edition as well.''
*
/smartcard
: Specifies that the credentials will be supplied from a smartcard.
*
/user
: Format is either
USER@DOMAIN
or
DOMAIN\USER
.
*
/showtrustlevels
: Shows help (list of usable trust level parameters) for the /trustlevel switch.
*
/trustlevel
: One of the trust levels listed by the /showtrustlevels switch.
*
program
: Command line for the executable file. ''See examples below.''
Note: Only type in the user's password, when the system asks for it.
Note: The
/profile
switch is not compatible with the
/netonly
switch.
Note: The
/savecred
and the
/smartcard
switches may not be used together.
Examples
runas /noprofile /user:machine\administrator cmd
runas /profile /env /user:domain\admin "mmc %windir%\system32\dsa.msc"
runas /user:user@domain.example.org "notepad C:\filename.txt"
runas /user:administrator /savecred "shutdown /i"
Inferno
The command is also included in the
Inferno
Inferno may refer to:
* Hell, an afterlife place of suffering
* Conflagration, a large uncontrolled fire
Film
* ''L'Inferno'', a 1911 Italian film
* Inferno (1953 film), ''Inferno'' (1953 film), a film noir by Roy Ward Baker
* Inferno (1973 fi ...
operating system.
Syntax
runas
writes the
user
to
/dev/user
and invokes
cmd
with the given
arguments
An argument is a statement or group of statements called premises intended to determine the degree of truth or acceptability of another statement called conclusion. Arguments can be studied from three main perspectives: the logical, the dialectic ...
.
runas user cmd rg...
Note: The command is only invoked if setting of the user name succeeds.
See also
*
Comparison of privilege authorization features
A number of computer operating systems employ security features to help prevent malicious software from gaining sufficient privileges to compromise the computer system. Operating systems lacking such features, such as DOS, Windows implementations ...
**
sudo
sudo ( or ) is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do", as that was all it did, and it i ...
**
doas
doas (“dedicated openbsd application subexecutor”) is a program to execute commands as another user. The system administrator can configure it to give specified users privileges to execute specified commands. It is free and open-source unde ...
*
Principle of least privilege
In information security, computer science, and other fields, the principle of least privilege (PoLP), also known as the principle of minimal privilege (PoMP) or the principle of least authority (PoLA), requires that in a particular abstraction la ...
*
User Account Control
User Account Control (UAC) is a mandatory access control enforcement feature introduced with Microsoft's Windows Vista and Windows Server 2008 operating systems, with a more relaxed , which disables the Administrator SID for the desktop, allowing it to re-enabled by exception.
References
Further reading
*
*
External links
Sysinternals ShellRunasAlternative Runas tools*
{{Windows commands
Operating system security
Microcomputer software
Computer security software
Windows administration
Inferno (operating system) commands