How to Recover deleted /etc/shadow password file
Hi friends,
By mistake i have deleted the /etc/shadow password file.I have also try to boot into single user mode,but system ask root password for maintenance don't know what to do in this case .Can anyone help me out with this issue it would be great for me.
Thanks in Advance.
Following are my PC Configuration:-
Amd 9550
gigabyte 780 with Intel Chipset
2gb ram
300 gb HDD
9600 gt 512
Re: How to Recover deleted /etc/shadow password file
Sure i will help you out with this I think that the passwd program is in /bin on Linux, so restore the /bin/passwd file from backups just as you would any other file. And be careful when you are acting as root.if you accidentally delete a very critical file you might not be able to run the restore program and at last you need to reinstall Linux
Re: How to Recover deleted /etc/shadow password file
The worst part of mine is i don't have a backup of my /etc/shadow password file and i don't want to re-install is there any other solution.
Following are my PC Configuration:-
Amd 9550
gigabyte 780 with Intel Chipset
2gb ram
300 gb HDD
9600 gt 512
Re: How to Recover deleted /etc/shadow password file
I was also facing such kind of issue i tried to follow the below steps and it worked for me hope it will work for you too:-
- Reboot server.
- Now you will see grub-boot loader screen. Select Recovery mode the version of the kernel that you wish to boot and type e for edit.
- Go to the end of the line and type init=/bin/bash as a separate one word and hit enterto exit edit mode.
- You would be back to grub-boot loader screen ype b to boot into single user mode and this would allow to gain root privileges (w/o password) and a root shell.
- Make sure can access system partition for that type the following code
- Now type the following code for rebuilding /etc/shadow file from /etc/passwd
- Use passwd command to change root user password
- If you have an admin account, then setup password for that account. On most case, servers direct root login is disabled.For enabling it type the following code.
- Now root and admin accounts are ready to go in multi-user mode. Reboot the system in full multiuser mode: