>  기사  >  시스템 튜토리얼  >  sudo 도구가 Windows에 출시됩니다: 사용 방법 및 이유

sudo 도구가 Windows에 출시됩니다: 사용 방법 및 이유

WBOY
WBOY원래의
2024-06-14 22:27:49799검색

Windows 설정을 조정하는 것을 좋아한다면 "상승된" 명령이나 관리자 수준 명령을 실행해야 하는 경우가 많습니다. 관리자 권한으로 명령 프롬프트를 실행하여 이 작업을 수행하는 데 익숙할 수도 있지만 Windows에서 sudo를 사용하면 훨씬 더 쉬워질 것입니다.

sudo 명령은 무엇을 합니까?

Windows에서 설정 앱과 사용하기 쉬운 구성 마법사를 통해 모든 것을 구성하는 데 일반적으로 중점을 두었음에도 불구하고 가끔씩 여전히 명령을 입력해야 합니다. 이들 중 다수는 표준 사용자 계정에서 작동하지 않습니다. 대신 관리자 권한으로 실행해야 합니다. 관리자 권한을 요구하는 것은 Windows에서는 여전히 비교적 새로운 개념이지만 이전 운영 체제에서는 훨씬 오랫동안 널리 사용되었습니다.

운영 체제 개발자가 수십 년 전에 문제에 대한 해결책을 생각할 정도로 널리 퍼졌습니다. Unix 설치에는 "사용자 전환"을 의미하는 su 명령이 있었고 지금도 있습니다. 이를 통해 계정을 다른 사용자로 전환할 수 있을 뿐만 아니라 기본적으로 시스템의 관리자 또는 수퍼유저 계정으로 실행할 수도 있습니다. su command, which means "switch user." This would allow you to switch accounts to any other user, but could also let you run as the administrator, or superuser, account of the system by default.

This solution worked, but logging in as the administrator to run one command seemed like overkill. As a solution, developers created the sudo command, which means either "switch user and do," or "superuser do," depending on various opinions. Long story short, the sudo command lets you easily run one command with elevated privileges—we've covered the differences between su and sudo if you're curious.

This means that the sudo command is roughly equivalent to right-clicking on the Command Prompt app, selecting Run as administrator, and running a command, like do_something. With the help of the sudo command, you don't need to worry about remembering to run the Command Prompt as administrator. Instead, simply type sudo do_something, and the command will work in exactly the same way.

Which Windows Versions Can Run the sudo Command?

Microsoft is adding the sudo command to Windows 11, and considering that support for Windows 10 is winding down, we don't expect to see the command coming there anytime soon. At the time of writing, the sudo command is only available for Windows Insider participants (builds 26045 and later), specifically those on the Developer and Windows Canary channels.

Unlike some features that Microsoft tests in these versions, it seems fairly likely that sudo is going to arrive on the operating system soon.

How to Enable the sudo Command on Windows

If the sudo command isn't yet available for your version of Windows, you'll need to sign up for Windows Insider. This is a simple process, but be warned: the Developer and Canary options can be unstable, so don't use them on a PC you're not willing to lose data on.

Once you're running a version of Windows that has the sudo command available, enabling it is a simple process. Open the Settings app, then select System on the left and For developers from the main area of the window.

Here, scroll down and enable the checkbox that reads Enable sudo.

The sudo Tool Is Coming to Windows: How and Why to Use It

Enable sudo via the Command Prompt

If you're more command-line oriented, you can also enable sudo via the Commmand Prompt. Somewhat ironically, this requires you to run an elevated CMD window. Press the Windows key, type "command," then right-click on Command Prompt (or PowerShell) and select Run as administrator.

In this prompt, run the following command:

<code class="hljs bash">sudo config --enableenable</code> 
The sudo Tool Is Coming to Windows: How and Why to Use It

How to Use the sudo Command on Windows

After you've enabled the sudo command on Windows, it's simple to use. Simply prepend the sudo command to any command you'd typically need to run as an administrator, then accept the prompts that follow.

An example from Microsoft uses the netstat

이 솔루션은 효과가 있었지만 하나의 명령을 실행하기 위해 관리자로 로그인하는 것은 과도한 것처럼 보였습니다. 해결책으로 개발자들은 다양한 의견에 따라 "사용자 전환 및 수행" 또는 "수퍼유저 수행"을 의미하는 sudo 명령을 만들었습니다. 간단히 말해서, sudo 명령을 사용하면 높은 권한으로 하나의 명령을 쉽게 실행할 수 있습니다. 궁금하신 분들을 위해 su와 sudo의 차이점을 다루었습니다. The sudo Tool Is Coming to Windows: How and Why to Use It

즉, sudo 명령은 명령 프롬프트 앱을 마우스 오른쪽 버튼으로 클릭하고 관리자 권한으로 실행을 선택한 다음 do_something과 같은 명령을 실행하는 것과 거의 동일합니다. sudo 명령을 사용하면 관리자 권한으로 명령 프롬프트를 실행해야 한다는 사실을 걱정할 필요가 없습니다. 대신 sudo do_something을 입력하면 명령이 정확히 동일한 방식으로 작동합니다.

어떤 Windows 버전에서 sudo 명령을 실행할 수 있나요? 🎜🎜 Microsoft는 Windows 11에 sudo 명령을 추가하고 있으며 Windows 10에 대한 지원이 줄어들고 있다는 점을 고려하면 해당 명령이 곧 제공될 것으로 예상하지 않습니다. 이 글을 쓰는 시점에서 sudo 명령은 Windows 참가자 참가자(빌드 26045 이상), 특히 개발자 및 Windows Canary 채널의 참가자에게만 사용할 수 있습니다. 🎜🎜 Microsoft가 이러한 버전에서 테스트하는 일부 기능과 달리 sudo가 곧 운영 체제에 출시될 가능성이 높습니다. 🎜

Windows에서 sudo 명령을 활성화하는 방법 🎜🎜 사용 중인 Windows 버전에서 sudo 명령을 아직 사용할 수 없는 경우 Windows Insider에 등록해야 합니다. 이는 간단한 프로세스이지만 주의하세요. 개발자 및 카나리아 옵션은 불안정할 수 있으므로 데이터 손실을 원하지 않는 PC에서는 사용하지 마세요. 🎜🎜 sudo 명령을 사용할 수 있는 Windows 버전을 실행하는 경우 이를 활성화하는 과정은 간단합니다. 설정 앱을 연 다음 왼쪽에서 시스템을 선택하고 창의 기본 영역에서 개발자용을 선택합니다. 🎜🎜 여기에서 아래로 스크롤하여 sudo 활성화라는 확인란을 활성화합니다. 🎜 sudo 도구가 Windows에 출시됩니다: 사용 방법 및 이유

명령 프롬프트를 통해 sudo 활성화

🎜 명령줄 중심이라면 명령 프롬프트를 통해 sudo를 활성화할 수도 있습니다. 다소 아이러니하게도 이를 위해서는 높은 수준의 CMD 창을 실행해야 합니다. Windows 키를 누르고 "command"를 입력한 다음 명령 프롬프트(또는 PowerShell)를 마우스 오른쪽 버튼으로 클릭하고 관리자 권한으로 실행을 선택합니다. 🎜🎜 이 프롬프트에서 다음 명령을 실행하세요: 🎜
<code class="hljs xml">sudo netstat -ab</code> 
Sudo 도구 출시 예정 Windows: 사용 방법 및 이유

Windows에서 sudo 명령을 사용하는 방법 🎜🎜 Windows에서 sudo 명령을 사용하면 사용이 간단합니다. 일반적으로 관리자로 실행해야 하는 명령 앞에 sudo 명령을 추가한 후 나타나는 프롬프트를 수락하면 됩니다. 🎜🎜 Microsoft의 예에서는 netstat 명령을 사용합니다. 🎜 rrreee🎜 🎜 이 기능은 다소 불필요해 보일 수 있으며 많은 사람들에게는 실제로 그렇습니다. 즉, Windows에서 명령을 계속 실행하면서 하루를 보내고 sudo 명령의 단순성을 원한다면 이 명령을 추가하면 생활이 더 쉬워질 것입니다. 🎜

Microsoft는 sudo 구현에 전념하고 있으며 GitHub에서 sudo를 오픈 소스로 출시하기까지 했습니다. 이 글을 읽고 Windows의 내부에서 무슨 일이 일어나는지 더 자세히 알고 싶다면 모든 Windows 사용자가 알아야 할 명령 목록을 살펴보세요.

위 내용은 sudo 도구가 Windows에 출시됩니다: 사용 방법 및 이유의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.