A linux-like su/sudo on Windows.
This is a demo project. It may have security vulnerability. SO RUN AT YOUR OWN RISK.
$ git clone https://github.com/DoubleLabyrinth/WindowsSudo.git
$ cd WindowsSudo
$ msbuild WindowsSudo.sln /p:Configuration=Release /p:Platform=x64 # or `x86` if you like
Then you will get
su.exe
sudo.exe
WindowsSudo.Prompter.exe
WindowsSudo.Service.exe
at bin/x64-Release
(or bin/x86-Release
) directory.
-
Move the four
exe
files to a directory which is-
in
%PATH%
environment variable -
is writable for administrators ONLY
For example, you can place the four
exe
files toC:\Windows\System32\
. -
-
Run
cmd.exe
as administrator and installWindowsSudo.Service.exe
as service.$ cd C:\Windows\System32\ $ WindowsSudo.Service.exe /install $ WindowsSudo.Service.exe /start
-
Enjoy
su
andsudo
with yourself.Example:
$ sudo whoami /priv