Ubuntuのパスワードリセットの方法

hackszine:HOWTO - reset a lost Ubuntu password

今日Ubuntuの仮想マシンを引っ張りだしてきたのだが,
なんと,パスワードを忘れてしまった.
こういうことは時々ある.
あなたがlinux初心者なら,慌ててしまうかもしれない.

I loaded one of my test Ubuntu virtual machines today (one that I hadn't used for a month) and, surprise, I had forgotten the password. This sort of thing happens from time to time, and if you're new to Linux, it can be a little disconcerting.

rootパスワードを無くしてしまうイコール世界の終わりではないのだ.
パスワードをリセットする為に,再起動してシングルユーザモードに入ればいいのだ.
以下が一般的なUbuntuでの手順だ.GRUB bootloaderを使う.

Losing your root password isn't the end of the world, though. You'll just need to reboot into single user mode to reset it. Here's how to do it on a typical Ubuntu machine with the GRUB bootloader:

シングルユーザモードでLinuxを起動する.
1.マシンを再起動
2.GRUBがロードされている時,ESCキーを押すとメニューに入れる.
3.もし「リカバリモードオプション」があれば,それを選んで「b」キーを押すと,シングルユーザモードになる.
4.もしデフォルトブート設定しかなければ,「e」キーで編集を行う.
5.「kernel...」で始まる行を選択して,再度「e」キーを押すとその行の編集が出来る.
6.行の最後に「single」というオペレータを追加し,enterで編集終了.「b」キーで起動する.

Boot Linux into single-user mode
1.Reboot the machine.
2.Press the ESC key while GRUB is loading to enter the menu.
3.If there is a 'recovery mode' option, select it and press 'b' to boot into single user mode.
4.Otherwise, the default boot configuration should be selected. Press 'e' to edit it.
5.Highlight the line that begins with 'kernel'. Press 'e' again to edit this line.
6.At the end of the line, add an additional parameter: 'single'. Hit return to make the change and press 'b' to boot.

システムがシングルユーザモードで起動したら,rootでログインしたのとおなじコマンドラインが現れる.
「passwd」コマンドでroot/adminのパスワードを変更できる.
passwd <新パスワード>

Change the admin password
The system should load into single user mode and you'll be left at the command line automatically logged in as root. Type 'passwd' to change the root password or 'passwd someuser' to change the password for your "someuser" admin account.

これが終わったら,祈りながらrebootコマンドを実行し,普通のモードで再起動する.

Reboot
Once your done, give the three finger salute, or enter 'reboot' to restart into your machine's normal configuration.

やるのはこれだけです.
もう忘れないようにポストイットにパスワードを書いて,キーボードの裏などに張っておく事!

That's all there is to it. Now just make sure to write your password down on a post-it and shove it somewhere safe like under your keyboard. :)

Posted by Jason Striegel | Sep 3, 2008 10:37 PM

Redhat系のLinuxでも,4.と同じ手順で変更できますよ

Comments

Anonymous said…
いつもresumeしてたので
久しぶりに再起動したら、
パスワードをすっかりわすれてた!

助かった!
Thanks!!!
Unknown said…
お役に立てて光栄です。
アクセスログを見ると、この記事は結構見て頂けているようです。

Popular posts from this blog

MacbookやiMacのSSD/HDDを完全消去する(High Sierra対応版)

conda clean --allはやってはいけない

Nintendo SwitchがあればChromecastはいらないぞ!