Hie
I lost my CentOS 7 root password, so I tried booting the OS in single user mode but it prompts me for the root password when the system boots,
Any ideas?
Regards
Bonnie
Should be do-able without the live CD:
At the GRUB menu, edit the kernel line, add init=/bin/sh to the end of it and boot from that.
You'll end up at the shell prompt, where you can change the password with the normal passwd command.
You may need to:
- mount -o remount,rw on your root partition before you'll be allowed to write any changes - touch /.autorelabel to make sure SELinux doesn't refuse the changes after you reboot (if you're enforcing SELinux, obviously)
You should then be fine to reboot and log in using the fresh password.
Not as elegant as just sticking a 1 on the end of the kernel line to get to single-user mode, but whatever, it works.
Paul
--
On 05/08/14 11:53, Bonnie B Mtengwa wrote:
Hie
I lost my CentOS 7 root password, so I tried booting the OS in single user mode but it prompts me for the root password when the system boots,
Any ideas?
Regards
Bonnie
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Tue, Aug 05, 2014 at 11:21:35AM +0000, Paul Jones wrote:
- mount -o remount,rw on your root partition before you'll be allowed to
write any changes
- touch /.autorelabel to make sure SELinux doesn't refuse the changes
after you reboot (if you're enforcing SELinux, obviously)
Or `/usr/sbin/load_policy -i` before remounting rw
On 05/08/14 12:26, Matthew Miller wrote:
On Tue, Aug 05, 2014 at 11:21:35AM +0000, Paul Jones wrote:
- mount -o remount,rw on your root partition before you'll be allowed to
write any changes
- touch /.autorelabel to make sure SELinux doesn't refuse the changes
after you reboot (if you're enforcing SELinux, obviously)
Or `/usr/sbin/load_policy -i` before remounting rw
Didn't realise that tool existed. That's a useful one, thanks.
Also just realised the previous top-post. Sorry list.
Paul
--
Thanks guys solved the issue using the LiveCD,
Regards
Bonnie
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Paul Jones Sent: Tuesday, 5 August 2014 1:36 PM To: CentOS mailing list Subject: Re: [CentOS] reset CentOS-7 lost root password
On 05/08/14 12:26, Matthew Miller wrote:
On Tue, Aug 05, 2014 at 11:21:35AM +0000, Paul Jones wrote:
- mount -o remount,rw on your root partition before you'll be allowed
to write any changes
- touch /.autorelabel to make sure SELinux doesn't refuse the changes
after you reboot (if you're enforcing SELinux, obviously)
Or `/usr/sbin/load_policy -i` before remounting rw
Didn't realise that tool existed. That's a useful one, thanks.
Also just realised the previous top-post. Sorry list.
Paul
--
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Tue, Aug 05, 2014 at 11:35:44AM +0000, Paul Jones wrote:
On 05/08/14 12:26, Matthew Miller wrote:
On Tue, Aug 05, 2014 at 11:21:35AM +0000, Paul Jones wrote:
- mount -o remount,rw on your root partition before you'll be allowed to
write any changes
- touch /.autorelabel to make sure SELinux doesn't refuse the changes
after you reboot (if you're enforcing SELinux, obviously)
Or `/usr/sbin/load_policy -i` before remounting rw
http://fedoraproject.org/wiki/How_to_reset_a_root_password#Using_GRUB2
I see the OP has solved their issue already.