0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSLでパスワードを忘れたので再設定したい

Last updated at Posted at 2025-05-24

パスワードを再設定する手順

  • ユーザ名確認
  • ルートユーザでログイン
  • パスワード変更

ユーザ名確認

まずはUbuntuを開き, 下記のコマンドを入力.

cat /etc/passwd

ユーザ名一覧が出てくるので, パスワードを変更したい対象のユーザ名を確認する.

ルートユーザでログイン

コマンドプロンプトを開き, 下記のコマンドを入力.
WSLにルートユーザでログインすることが出来る.

wsl -u root

パスワード変更

上記コマンドプロンプト上で以下のコマンドを入力.
※[username]と[new_password]はあなたの場合に当てはめてください.

passwd [username] [new_password]

以上で終了.

参考記事

WSL で Ubuntu のユーザーパスワードを忘れた場合のリセット方法
【Linux入門】ユーザー一覧を確認する方法をわかりやすく解説!

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?