DEV Community

Cover image for Sudo in Windows 10
Max Pixel
Max Pixel

Posted on • Edited on

Sudo in Windows 10

ssh max@localhost

It's longer than sudo, but it's shorter than Start-Process Powershell -Verb runAs (and doesn't open a new window).

But, Max, that's just an SSH login command!

That it is! Windows 10 has built-in OpenSSH now, both server and client. It just so happens that the Windows 10 SSH server gives administrative users an administrative context. It's understandable why they would do it that way, given that Windows doesn't have a sudo equivalent, and that SSH is often used for remote administration.

So, whenever I need to bash out a Chocolatey command, or... is there anything else I ever need an administrative console for? Anyways, whenever I need to do that, instead of opening a new Windows Terminal window, I just ssh max@localhost my way to super-user success!

Top comments (0)