Sudo for Windows - How to Enable it, and How to Use it

preview_player
Показать описание
Microsoft has launched 'sudo' for Windows. It allows you to to execute a command as the administrator, with elevated privileges. It is akin to the 'sudo' command on Linux. In this video I show you how to enable it, and how to use it.
---

#garyexplains
Рекомендации по теме
Комментарии
Автор

i am CONVINCED that Microsoft devs have hour long meetings to discuss how to make their software as difficult to use as possible

skolarii
Автор

I much prefer the Linux implementation of sudo. Is there an advantage of using sudo in PowerShell over running PowerShell as administrator?

drbowater
Автор

I always thought sudo was pronounced su-doe. I stand corrected Gary (it makes sense the way you explained it). Cheers. $0.02

MatthewHarrold
Автор

The forceNewWindow setting also has another important implication it seems: It started a new CMD running from the SYSTEM32 directory, and showed you that directory listing output. While the inline version shows what you'd expect it would show: your homedir from where you launched the command!
And that is VERY important - because when you'd create a new directory with mkdir like in your other example, it would just create that under the system32 directory OR in c:\program files, depending on the sudo configuration - lol. So to make this work universally, we'd always need to use something like : mkdir "C:\program files\zob"

maxhax
Автор

Does Windows not remember the granted credentials at least for a while? Because on Linux sudo will remember the password for at least 15 minutes for the given session and you don't need to be prompted every time

otherwise a welcome change, albeit weird to see :p

iodreamify
Автор

I've been using something called GSUDO for some time just for this very reason, because I needed a way to elevate stuff at the command line. GSUDO is much more capable than what Microsoft is putting out so I'm going to continue using GSUDO instead.

trparky
Автор

I wonder, can you do “sudo cmd.exe” to get an elevated shell where you don’t have to keep answering the elevated command dialog?

paulmilligan
Автор

Powershell makes me sad
Sometimes you just want to execute a quick command to output a grep of something.
PS usually makes these commands lengthy, convoluted and dissimilar from bash.
I end up feeling like I need an IDE just to do simple stuff that I could easily do on the fly in bash

technolus
Автор

Thanks for sharing Gary. Also, were you logged into Windows with a local admin account? Looks like you were from the UAC prompt. What happens if the local account is a standard user? I'm assuming you are promoted for a password?

RPG_ash
Автор

Did you look deeper into why it seems to be displaying *different* directory listing whether you run [Window's] sudo outputting to a new window or not?

WoodyWilliams
Автор

This will be really useful. There have been times I have wanted to run a powershell as another user and as admin. You can't do both at the same time. This will fix that.

paulbarnett
Автор

What’s the point if you have the “Run as administrator” option?

kazems
Автор

Inline should have 100% been the default. Why wouldn't the way we'd all expect to see it be the default???

Great vid, answered all my questions without taking up too much time or feeling rushed. Thank you!

omfgximjustin
Автор

Windows is becoming Linux now... Thank you very much, Microsoft.

And please, arrange that the normal users do not have administrative (super user) privileges by default. That would make Windows much safer to run.

arijarmala
Автор

And whats the point? How is it different than opening a cmd as admin then insert your command? I thought it will run the command without asking for a graphical confirm (uac clicking) - now it is pointless. If you have to click on OK i run it in elevated, you can also right click on cmd and run as admin or you write cmd in the run window and ctrl+shift+enter it will open as admin instantly and no further questions. I dont get the benefit for this command yet.

ferencvigvari
Автор

Am i the only one, who only uses cmd line tool in Linux and never on a Windows? 🤔
Only if i'm forced to do it because the guide says it. Otherwise i'll just click around in the windows.

robina.jensen
Автор

I don’t have option to enable that sudo toggle, please need assistance to enable it. Getting error “Sudo is not recognised as internal and external command”

soumalyadas
Автор

Why is w11 so damn bloated? 300+ processes for what? In w10 I have barely 150.

metalhead
Автор

If Microsoft wanted you to take control of your own system, they would not have built Windows11

nathanwilliams
Автор

So they broke sudo. essentially MS need to improve the cmd shell before they try get any fancier.

eddrake