Windows 11 now has sudo, and it’s safer


If you’ve ever accidentally entered the wrong command in Command Prompt or PowerShell you aren’t alone—everyone does it eventually. Fortunately, one of Linux’s best safeguards is now available for the Windows Terminal.

Sudo is a vital part of Linux’s safety net

What is sudo?

Windows laptop with the Command Prompt open displaying a 'sudo' command. Credit: Lucas Gouveia / Jason Fitzpatrick / How-To Geek

Sudo, which is short for superuser do, or substitute user do, is a feature typically found on Linux systems like Ubuntu or Fedora.

Sudo allows you to run a single command with administrative privileges without actually needing to log in to the root (administrator) account.

linux laptop


What Is “root” on Linux?

The Linux root user can do whatever they choose, period. And that’s a huge double-edged sword.

Despite how minor that seems, it is an important security feature. Sudo puts up a small wall that prevents you from doing something destructive by accident.

Consider the case where you’re following old instructions online. You’re going step by step with your normal user account, then suddenly a command doesn’t run correctly because it requires sudo. Immediately, that forces you to stop and consider carefully what the command is actually doing. Is it acting on a protected file? Is it trying to change services related to security? Why exactly does this command need root privileges?

You also have to enter your sudo password to install applications, which ensures you won’t unknowingly run something malicious.

It encourages a more deliberate approach to invoking root—or administrative—privileges in a way that Run as Administrator on Windows doesn’t

Run as administrator isn’t as safe as sudo

All-or-nothing admin privileges aren’t good

Run as admin option in context menu

Sometimes you need administrative privileges to run something on Windows, just like on Linux. When that happens, you have two options: Log directly into the administrator account or launch Terminal as Administrator.

Most of the time, you right-click then select Run as Administrator. However, while it bears a superficial similarity to how sudo works, it is different in practice.

Once you launch a Terminal is administrator, everything you do within it will be run as administrator. Want to delete something you shouldn’t? Go right ahead. Enter a command without considering the security implications? Sounds good—go right ahead.

It is an all-or-nothing approach that unnecessarily creates the potential for a command to go badly amiss. Sudo, on the other hand, forces you to type sudo every single time you want to use it. So long as you’re not carelessly copy-pasting from the internet, it serves as a constant reminder that the command you’re about to enter has no safeguards.

Using your PC directly from the administrator account is bad practice, and you shouldn’t do it under normal circumstances. The account is disabled by default; I’d recommend you leave it that way.

Sudo makes using the command-line interface in Windows easier

Switching to admin or logging into another account is a drag

Above and beyond the added security and safety benefits, sudo is also just plain convenient in a way that run as administrator isn’t.

Under normal circumstances, regardless of the operating system you’re using, you don’t want to run every single command as administrator. That’s why you don’t normally log into the administrator account on Windows or into Root on Linux.

You should be running everything you can on Windows in a non-administrator terminal, and then only invoke administrative privileges when you actually need them. Unfortunately, because of the way Windows works, that means you need to switch back and forth between two different Terminal windows.

On the other hand, sudo allows you to just invoke administrative privileges on the fly, only as you need them.

It isn’t the biggest convenience feature in the world, but once you get used to it, its absence on Windows is extremely noticeable.

Installing Sudo on Windows

Bringing the best Linux feature to Windows

Fortunately, Microsoft has introduced the sudo command, in all its glory, to Windows 11. To enable it, press Windows+i to open the Settings app.

From there, navigate to System > Advanced, then click the toggle next to Enable Sudo. I’d also recommend that you change how it runs from In a new window to Inline, which is how it behaves normally on Linux.


Small quality of life updates matter

Sudo isn’t a necessary or game-changing feature, but it one thing that Linux unequivocally does better than Windows. If you spend any amount of time working with Windows via the command-line, it is a very welcome improvement.



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


Do you ever walk past a person on the streets exhibiting mental health issues and wonder what happened to their family? I have a brother—or at least, I used to. I worry about where he is and hope he is safe. He hasn’t taken my call since 2014.

James and his brother as young children playing together before his brother became sick. James is on the right and his brother is on the left.

James and his brother as young children playing together before his brother became sick. James is on the right and his brother is on the left.

When I was 13, I had a very bad day. I was in the back of the car, and what I remember most was the world-crushing sound violently panging off every surface: he was pounding his fists into the steering wheel, and I worried it would break apart. He was screaming at me and my mother, and I remember the web of saliva and tears hanging over his mouth. His eyes were red, and I knew this day would change everything between us. My brother was sick.

Nearly 20 years later, I still have trouble thinking about him. By the time we realized he was mentally ill, he was no longer a minor. The police brought him to a facility for the standard 72-hour hold, where he was diagnosed with paranoid delusional schizophrenia. Concluding he was not a danger to himself or others, they released him.

There was only one problem: at 18, my brother told the facility he was not related to us and that we were imposters. When they let him out, he refused to come home.

My parents sought help and even arranged for medication, but he didn’t take it. Before long, he disappeared.

My brother’s decline and disappearance had nothing to do with the common narratives about drug use or criminal behavior. He was sick. By the time my family discovered his condition, he was already 18 and legally independent from our custody.

The last time he let me visit, I asked about his bed. I remember seeing his dirty mattress on the floor beside broken glass and garbage. I also asked about the laptop my parents had gifted him just a year earlier. He needed the money, he said—and he had maxed out my parents’ credit card.

In secret from my parents, I gave him all the cash I had saved. I just wanted him to be alright.

My parents and I tried texting and calling him; there was no response except the occasional text every few weeks. But weeks turned into months.

Before long, I was graduating from high school. I begged him to come. When I looked in the bleachers, he was nowhere to be seen. I couldn’t help but wonder what I had done wrong.

The last time I heard from him was over the phone in 2014. I tried to tell him about our parents and how much we all missed him. I asked him to be my brother again, but he cut me off, saying he was never my brother. After a pause, he admitted we could be friends. Making the toughest call of my life, I told him he was my brother—and if he ever remembers that, I’ll be there, ready for him to come back.

I’m now 32 years old. I often wonder how different our lives would have been if he had been diagnosed as a minor and received appropriate care. The laws in place do not help families in my situation.

My brother has no social media, and we suspect he traded his phone several years ago. My family has hired private investigators over the years, who have also worked with local police to try to track him down.

One private investigator’s report indicated an artist befriended my brother many years ago. When my mother tried contacting the artist, they said whatever happened between them was best left in the past and declined to respond. My mom had wanted to wish my brother a happy 30th birthday.

My brother grew up in a safe, middle-class home with two parents. He had no history of drug use or criminal record. He loved collecting vintage basketball cards, eating mint chocolate chip ice cream, and listening to Motown music. To my parents, there was no smoking gun indicating he needed help before it was too late.

The next time you think about a person screaming outside on the street, picture their families. We need policies and services that allow families to locate and support their loved ones living with mental illness, and stronger protections to ensure that individuals leaving facilities can transition into stable care. Current laws, including age-based consent rules, the limits of 72-hour holds, and the lack of step-down or supported housing options, leave too many families without resources when a serious diagnosis occurs.

Governments and lawmakers need to do better for people like my brother. As someone who thinks about him every day, I can tell you the burden is too heavy to carry alone.

James Finney-Conlon is a concerned brother and mental health advocate. He can be reached at [email protected].



Source link