0
2

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.

Linux の root パスワードをリセット(設定)する方法

Posted at

たまたま、VirtualBox のイメージを入手したところ、そのイメージには、root パスワードが設定されておらず、ユーザ名とパスワードは分かったものの、sudo コマンドを発行しても sudoers に記述がないため、管理者の動作ができませんでした。
そこで、root パスワードを設定しなければなりません。

  • マシンを起動し、grub メニューで "e" を押下
  • linux16 の行に移動
  • ro を rw init=/sysroot/bin/sh に修正
  • Ctrl+x を押下
  • :/# chroot /sysroot
  • :/# passwd root
  • :/# touch /.autorelabel
  • :/# exit
  • :/# reboot

再起動後、ログインして、su コマンドを発行、さきほど設定したパスワードで root になれましたー。

参考:How To Reset Root Password On CentOS 7

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?