Well if you come to the real sense, this is not exactly called as hacking. The trick is just removing root password without administrator login.

This is a way to clear the root password when you don’t have access to the vi editor.

Example

Flavors: AT&T, BSD

If no one has access to the root password on a system and it is a matter of urgency to get into that system, you can boot miniroot and clear the password out of the root account. This can be done even when the vi editor is inaccessible. To do this on a system using the /etc/shadow file, use the ed editor with 13 dots and your problems are solved:

Line 2: Switch the first occurrence of a field that has 13 characters with nothing. This is the password field.

Line 3: Write out the file.

Line 4: Quit.

You’re finished! You swapped out the 13 characters of root’s password field with nothing and cleared the password. You can now bring the system to single user and change the root password. The same basic commands can be used on the /etc/passwd file for those platforms that don’t support shadow passwords. The result is the same. 😀