Operating System - Linux
1821539 Members
2194 Online
109633 Solutions
New Discussion юеВ

how to enable expire root account -- plz help asap

 
SOLVED
Go to solution
Maaz
Valued Contributor

how to enable expire root account -- plz help asap

Dear Gurus

OS: rhel 4
Mistakenly I have issue the following command
#chage -E 24-4-06 root
and root cant login now

second.. on another system I have deleted bash(/bin/bash)

Regards
Maaz
9 REPLIES 9
Rick Garland
Honored Contributor
Solution

Re: how to enable expire root account -- plz help asap

Reboot 1st system and login single user mode

'chage root' on 1st box to reset the passwd security (this will be interactive so you can see the present values as well.)

On 2nd system, if you still have login prompt, get a copy of the /bin/bash from another system or from backup
Maaz
Valued Contributor

Re: how to enable expire root account -- plz help asap

Thanks a lot Dear Mr Rick Garland for help ;)

Thanks
Regards
Maaz
Maaz
Valued Contributor

Re: how to enable expire root account -- plz help asap

I cant login into the system

(none)login:root
password:

and then again I got the login prompt

(none)login:

Plz help asap
Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: how to enable expire root account -- plz help asap

Is this the system that you expired the root account? Is this the system that has no shell?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: how to enable expire root account -- plz help asap

the system with no shell
rm -f /bin/bash
Maaz
Valued Contributor

Re: how to enable expire root account -- plz help asap

rm -f /bin/bash
on a system /bin/bash has deleted. Now I cant login on the system

(none)login:root
password:

and then again I got the login prompt

(none)login:

No backup :(

Plz help asap
Regards
Maaz
Vitaly Karasik_1
Honored Contributor

Re: how to enable expire root account -- plz help asap

for restoring bash you can boot from any linux cd, mount your hard disk and copy bash binary from some working system with the same linux version or from floppy or USB disk.
Ivan Ferreira
Honored Contributor

Re: how to enable expire root account -- plz help asap

Start the system in single user. Then you have two options:

1- Edit the /etc/passwd file and change the shell.

2- Copy an existing shell to /bin/bash

For example:

cp /bin/ksh /bin/bash
cp /bin/csh /bin/bash
cp /bin/zsh /bin/bash

You can use any of these shells.

If you cannot boot in single user, edit the grub boot options, at the grub boot prompt press "a" and add:

init=/bin/ksh

Use any of the existing shells. If the root mounts read only, run:

mount -o rw,remount /

After that, boot in normal mode and reinstall the bash rpm from the CD:

rpm -ivh bash-.rpm --force
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: how to enable expire root account -- plz help asap

Thanks Dear Vitaly Karasik for help
I boot the system in rescue mode, and the issue the following command:
chroot /mnt/sysimage
chroot: cant execute /bin/sh: No such file or directory

Thanks Dear Ivan Ferriera for help I followed ur intructions
1, edit the grub boot options by providing init=/bin/ksh as parameter
2, mount -o rw,remount /dev/hda2
3, then I installed the rpm from cd
Now Its working fine ;)

Regards
Maaz