[linux] Erase root password

You can do this by deleting x in / etc / passwd.

$ vi /etc/passwd


From left to right, the user name, password, user ID, group ID, comment, home directory, and login shell.

The password here is the second x from the left. This means an encrypted password. I'm scared if I can see it.

By deleting this, you will be able to log in without a password.

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


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

Let's log in from the hoge user

[[email protected] ~]$ su -
[[email protected] ~]$ 

I was able to become root without being asked for my password!

By the way, under normal circumstances, only the root user or someone with sudo privileges can edit / etc / passwd.

Recommended Posts

[linux] Erase root password
[Linux] Change user password
[Linux] Directory under the root
Building LAMP with Linux MINT Cannot log in with mysql root password