Sometimes you're given a box to administer, and guess what? The person who knew the root password is nowhere to be found. What can you do? Why, use Knoppix(or other Linux Live CD), of course! With Knoppix(or other Linux Live CD), you can easily change the root password — or, more accurately, remove the root password so that you can then change it to whatever you want.
After booting with Knoppix(or other Linux Live CD), mount the partition containing the /etc directory in which you're going to muck about. Make sure that it's writable — right-click on the partition icon, choose Properties, open the Device tab, uncheck Read only, click OK, and then click on the partition icon to mount it.
After mounting the partition, run cd /etc and then use your favorite text editor to open the /etc/shadow file (we prefer vi, but you can use any editor you want, as long as you're running it as root). Once /etc/shadow is open, find the line containing root's information, as shown in the following example:
root:$1$k2xzdNaz$X.Fq9Xgp9.dhkTszwt4FP1:12893:0:99999:7:::
Delete the stuff between the first and second colons, so that the line now looks like this:
root::12893:0:99999:7:::
Save the text file, and the next time you reboot, root will not have a password. This is obviously a very dangerous situation, so you should assign root a new (good) password as soon as possible.
Now that was pretty easy, wasn't it?



0 komentar:
Post a Comment