6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WSL でユーザーを作らずに root で作業する

Posted at

ユーザーを root だけにする

Microsoft ストア からインストールした後、初回起動時に

Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:

と新規ユーザーの名前を入力することを求められる。ここで、 root と入力すると

Enter new UNIX username: root
adduser: The user `root' already exists.
Enter new UNIX username:

と先に進めないが、ここで Ctrl + C を押すとウィンドウが閉じる。
もう一度、スタートメニューから起動すると root ユーザーとしてログインされた状態で起動する。

通常のインストール

通常、ここでユーザー名を入力するとパスワードの入力を求められ、2度同じパスワードをタイプするとインストールが完了する。

Installing, this may take a few minutes...
Installation successful!
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: username
New password:
Retype new password:
passwd: password updated successfully
Use same password for root user?
Type "y" to approve, any other key to reject: y
Default UNIX user set to: username
username@HOSTNAME:~>
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?