LoginSignup
0
0

More than 3 years have passed since last update.

[linux]rootのパスワードを消す

Posted at

/etc/passwd の中の、 x を消せば可能になります。

$ vi /etc/passwd

root:x:0:0:root:/root:/bin/bash

左から順に、ユーザ名・パスワード・ユーザID・グループID・コメント・ホームディレクトリ・ログインシェルになってます。

ここでパスワードに当たるのは、左から2つ目の x です。これは暗号化されたパスワードを意味しています。見れたら怖いですからね。

ここを消してあげることで、パスワードなしでログインが可能になります。

- root:x:0:0:root:/root:/bin/bash

↓

+ root::0:0:root:/root:/bin/bash

hogeユーザからログインしてみましょう

[hoge@111111111111 ~]$ su -
[root@111111111111 ~]$ 

パスワードをきかれずにrootになることができました!

ちなみに、普通の環境だと /etc/passwd を編集できるのは rootユーザかsudo権限が使える人のみになります。

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