zillah Posted December 19, 2005 Report Share Posted December 19, 2005 (edited) I have got Linux FC4 , I forgot password for root. How can I recover it through rescue CD1 (I did it through GRUB), but I am looking to do it through CD1I used FC4 CD1 to boot PC in rescue mode1- F5 for recue mode2- Type in : rescue mode----press Enter.2- chroot /mnt/sysimage3- Sh-2.95b # passwd root,,,,the output was :Passwd: system_u:system_r:anaconda_t is not authorized to change the password of root4- I tried type in : passwd (with out word "root" see step 3)Where is my mistake ? Edited December 19, 2005 by zillah Quote Link to post Share on other sites
naraku9333 Posted December 19, 2005 Report Share Posted December 19, 2005 Start booting normaly but at grub screen type e, add single to kernel parameter, press enter and then b to boot into single usrer mode (logs in as root with no password). You can then do passwd root to change it (I don't belive you will be asked for current password, but am not certain). If that doesn;t work you will need to edit /etc/shadow. Quote Link to post Share on other sites
zillah Posted December 21, 2005 Author Report Share Posted December 21, 2005 Thanks naraku9333 I am looking to recover the password through CD1 ....not through GRUB, I am familiar with GRUB.The reason I am doing that for learning. Quote Link to post Share on other sites
shanenin Posted December 21, 2005 Report Share Posted December 21, 2005 (edited) what you are doing looks like it should work. I have never used the fedora disks in that fashion. If you would like to learn a universal way that would work with any distro. I will show you. You will need to use a live linux cd like knoppix, or any of the others available.First you will need to boot your knoppix cd. Then open up a shell and change to the user root with the su command. You will then need to figure out where your root(main) linux partition is located. /dev/hda is your first ide(primary) drive, /dev/hdb is your second ide(slave) drive. You will use the fdisk command to print out your partition table. Since linux is installed on my primary drive, /dev/hda, I will use this command, it then prints the following infomainbox shane # fdisk -l /dev/hda Disk /dev/hda: 80.0 GB, 80026361856 bytes255 heads, 63 sectors/track, 9729 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 1 3824 30716248+ 83 Linux/dev/hda2 3825 3848 192780 83 Linux/dev/hda3 3849 3911 506047+ 82 Linux swap / Solaris/dev/hda4 3912 9729 46733085 5 Extended/dev/hda5 3912 7558 29294496 83 Linux/dev/hda6 7559 9729 17438526 83 LinuxI have three different distros installed, they are located at /dev/hda1, /dev/hda5, and /dev/hda6. for my example I will change the password for the linux distro installed at /dev/hda1.you will then need to make a mount point, this is a place to attach your partition. This can be a directory located anywhere, it can be named anythingmkdir /mnt/linuxnow you will need to mount(attach) your linux partition to that directorymount /dev/hda1 /mnt/linuxThe following command probably is not needed, but it may be. Just in case the proc file system is needed to set your root password, do the followingmount -t proc proc /mnt/linux/procnow you can change the root directoy using the chroot commandchroot /mnt/linux /bin/bashnow you should be able to set you root passwordpasswd rootnow make sure you exit out properly with the commandexit Edited December 22, 2005 by shanenin Quote Link to post Share on other sites
zillah Posted December 22, 2005 Author Report Share Posted December 22, 2005 Thanks shanenin for this nice and detailed explaination/dev/hda is your first ide(primary) drive, /dev/hdb is your second ide(slave) drive.You meant salve on the first ide (primary), not second. Because for second ide it will be named as hdc and hdd,,,,,,,,,,didn't you ?/dev/hda2 3825 3848 192780 83 LinuxWhat have been installed here ?Again thanks for this explaination Quote Link to post Share on other sites
shanenin Posted December 22, 2005 Report Share Posted December 22, 2005 You meant salve on the first ide (primary), not second. Because for second ide it will be named as hdc and hdd,,,,,,,,,,didn't you ?I think your ide devices are labled like this:ide0 master /dev/hda -firstide1 slave /dev/hdb -secondide2 master /dev/hdc -thirdide3 slave /dev/hdd -fourthI guess I am not sure. I may be lableing them wrong, I assumbed the master and slave were two seperate ide devices. Maybe someone else can jump in and clarify :-)/dev/hda2 3825 3848 192780 83 LinuxWhat have been installed here ?that is my boot partition, you may or may not have one. the boot partition contains both my kernel and grub files. It is not nessesary to have a seperate partition for your /boot directory. Quote Link to post Share on other sites
zillah Posted December 22, 2005 Author Report Share Posted December 22, 2005 (edited) I think your ide devices are labled like this:ide0 master /dev/hda -firstide1 slave /dev/hdb -secondide2 master /dev/hdc -thirdide3 slave /dev/hdd -fourthIn your motherboard you have two IDEs (controllers) which are IDE0 (primary) and IDE1 (secondary).In each IDE you can two hard disks master and slave,,,That means :1- You have primary master (Linux hda) and primary slave (Linux hdb).----If both HD are connected to one cable to IDE0 (primary) then linux will name them hda and hdb respectivly2- You have secondary master (Linux hdc) and secondary slave (Linux hdd).------If both HD are connected to one cable to IDE1 secondary then linux will name them hdc and hdd respectivly Edited December 22, 2005 by zillah Quote Link to post Share on other sites
shanenin Posted December 22, 2005 Report Share Posted December 22, 2005 Thank you for clarifying that, you are definately correct. I think I was confused by the way grub names its hard driveshd0 -first harddrivehd1 -second harddrivehd2 - third harddrivethat made me think incorrectly the following was also true:ide0 -first device ide1 -second deviceide2 -third devide Quote Link to post Share on other sites
zillah Posted December 22, 2005 Author Report Share Posted December 22, 2005 May be this link usefulhttp://linuxgazette.net/107/tomar.html Quote Link to post Share on other sites
iccaros Posted December 28, 2005 Report Share Posted December 28, 2005 (edited) I have got Linux FC4 , I forgot password for root. How can I recover it through rescue CD1 (I did it through GRUB), but I am looking to do it through CD1I used FC4 CD1 to boot PC in rescue mode1- F5 for recue mode2- Type in : rescue mode----press Enter.2- chroot /mnt/sysimage3- Sh-2.95b # passwd root,,,,the output was :Passwd: system_u:system_r:anaconda_t is not authorized to change the password of root4- I tried type in : passwd (with out word "root" see step 3)Where is my mistake ?sorry this took so long.. I did not see this threadsee this site ..http://searchopensource.techtarget.com/tip...i1151572,00.htm it looks like it did not make you root? why ... I believe you are running SELINUX on.. yes?if so then booting from a cd would not be at the lowest label (the lable at which booting from grup single would be)this is a secuerity feture added in SELINUX .... a cdrom from boot doing a chroot should come in at a mid-level label (haveing no labels its self) The way you did it would work on FC - FC 3 but not FC4 Edited December 28, 2005 by iccaros Quote Link to post Share on other sites
zillah Posted December 28, 2005 Author Report Share Posted December 28, 2005 sorry this took so long.. I did not see this threadThanks for your reply.SELINUX on.. yes?Yes,,,this is my problem,,,,How can I disable this. Quote Link to post Share on other sites
iccaros Posted December 28, 2005 Report Share Posted December 28, 2005 sorry this took so long.. I did not see this threadThanks for your reply.SELINUX on.. yes?Yes,,,this is my problem,,,,How can I disable this.short answer is you can't..you must be root and you must have the correct lables (inode keys) to come in as root. Red Hat is testing SELINUX in Fedora core 4 and have not created to correct tools for administration as of yet..you must know the root password to log in as root and set enforce = 0 (selinux enforce =0)sorry, But you may have to rebuild. Remeber SELIUNUX is not ment for causal use.. its ment to lock down to US Government standards for a Trusted systems (IE Trusted Solaris) the long short answer..you might try booting with a non-selinux disk (knoppix) mount your partition and then chroot /mountpoint /bin/bashthen change password.. the problem is you will have to reset file inforamtion back to SELINUX before booting the main system, problem agian is you need to be sysadm_r role to do so.. as you justed saved a file with no inode information.. (aka labels..)if you have no need for that much secuerity (most users will not) then I would reinstall with selinux offhelpfull documentationhttp://www.crypt.gen.nz/selinux/install_fedora.html Quote Link to post Share on other sites
zillah Posted February 6, 2006 Author Report Share Posted February 6, 2006 I rested the password , I was able to login without any problem after reseting,,,after while (I have not used Linux PC for about 20 days) I came again,,,I could not login!!!Can be there is something (some setting mistakenly I configured it when i installed FC4) changing the password ? Quote Link to post Share on other sites
iccaros Posted February 7, 2006 Report Share Posted February 7, 2006 I rested the password , I was able to login without any problem after reseting,,,after while (I have not used Linux PC for about 20 days) I came again,,,I could not login!!!Can be there is something (some setting mistakenly I configured it when i installed FC4) changing the password ?if you get back in.. check under /etc/defultthis is defult setting for users and the system.. in mine I have a file called useradd.. which says that expire = 180.. meaning that user accounts expire in 180 days if not used.. you may have something simular.. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.