What will happen if i simply remove it and reboot? Will it ask for a new
password or what?
Pls advise. Thanks.
don't trust me though :-)
Don't remove the whole line, just remove the password part.
Here's an example:
root:$1$AAoxxU.8$auu1uBprTz0gCKi4QCf5b1:11636:0:::::
Change that to:
root::11636:0:::::
And you will have no password for root. You can then login as
root by just hitting the return key at the password prompt (su
won't even prompt for a password), and the next step would be to
run /passwd/ and set a new password. Use something that you
won't forget!
Some systems will let you go to single user and give you a root
shell without a password, so try that first. If that works,
just run /passwd/ to set a new password and then go back to
multiuser mode. You don't actually need to even reboot.
Otherwise, in order to remove it you'll need to boot from a
rescue disk, an intallation CD, a spare root partition, or
something else that gives you a root shell with at least a few
minimal commands available.
If you get access by booting into something other than your
normal root filesystem, you will need to mount your normal root
partition and edit the shadow file. For example, if your normal
root partition is /dev/hda1, and it has an ext2 filesystem:
mount -t ext2 /dev/hda1 /mnt
You should first save a copy the file,
cp /mnt/etc/shadow /mnt/etc/shadow.orig
and then use whatever editor is available to edit it. If you
have no editor at all, things get only slightly more
complicated. Just make a temporary /etc/shadow file that will
allow you to reboot and login as root:
echo "root::11636:0:::::" > /mnt/etc/shadow
Then reboot, login as root and copy the /etc/shadow.orig file
back to /etc/shadow before running /passwd/ to set a new
password.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) fl...@barrow.com
Remover the :x: in /etc/passwd for root. This will make the account
passwordless. Or log on in single user mode (linux 1 at the lilo prompt)
and then run passwd to make a new password for root.
Rather than remove, it, why not change it?
When you boot Linux, add "init=/bin/sh" to the command line.
When it comes up, run
mount / -o remount,rw
passwd
mount / -o remount,ro
And then power off the computer. (The shutdown command won't
necessarily work, so we use the mount command to put the root
filesystem in a safe state.)
When you power back up, your password should be whatever you set it to
when prompted by the passwd command.
DISCLAIMER: These comands worked for me yesterday on one of my Debian
boxen. I believe they'll work for other distributions, but I'm not
sure. You may be required to type the full path to the commands.
Some, but certainly not all, systems have their grub.conf or lilo.conf
password locked so you need a password to change the boot options. That's
why a rescue CD comes in handy, or if the BIOS is locked as well, pulling
out the hard drive and mounting it on another machine to make the changes.
> > When you boot Linux, add "init=/bin/sh" to the command line.
>
> Some, but certainly not all, systems have their grub.conf or
lilo.conf
> password locked so you need a password to change the boot options.
That's
> why a rescue CD comes in handy, or if the BIOS is locked as well,
pulling
> out the hard drive and mounting it on another machine to make the
changes.
I do a lot of servicing on friends' Linux laptops. Even the occasional
desktop someone brings in for me to look at. I've never been asked for
a bassword when modifying kernel parameters from the menu.
I'm not saying it's not possible; I've gone through the lilo docs
enough to know exactly how to do it. (grub's still somewhat new to me;
I'm using it on one of my machines, but it hasn't yet shown substantial
advantages for me.)
However, I've gradually come of the opinion that your average home
Linux user doesn't password-protect their boot menus, and, as long as
distros don't enable it by default, they're unlikely to.
--
-bill davidsen (davi...@tmr.com)
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me