Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Forgotten password - red hat

  • 05-02-2004 1:32pm
    #1
    Closed Accounts Posts: 1,723 ✭✭✭


    I installed Red hat 7 on an old pc and i have stupidly forgotten my password or it could even be my uisername i forgot.

    Anyways, is there any way around this without having to reload the system. The pc isn't on a network or anything and its really just a standard install of red hat.

    I heard something about getting a command line up at the Grub screen by pressing a short cut key and going from there. Does anybody out there know anything about this.


Comments

  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    You may or may not be running a boot loader. Anyway at the boot prompt type 'linux single'. This will boot you into single user mode. Now open the /etc/shadow file and remove the (encrypted) password on the line that begins with "root:xxxxx:" (leave the colons though).


    Now reboot as normal. There should now be no password set on the root a/c.
    (In fact you are probably better running passwd once you have deleted the old entry)


    davej


  • Registered Users, Registered Users 2 Posts: 1,569 ✭✭✭maxheadroom


    or, if you can't manage to start your linux system, knoppix will allow you to do the same thing as davej suggested.


  • Closed Accounts Posts: 741 ✭✭✭longword


    Originally posted by empirix
    I heard something about getting a command line up at the Grub screen by pressing a short cut key and going from there. Does anybody out there know anything about this.
    Single user mode is what you're after, and you get that by adding the option 'single' to your boot command in GRUB. I'm not sure about older versions of grub but I think it's 'a' to append an option to your boot, then 'b' to go with that. Then set the password with 'passwd'. There's no need to edit the files by hand.


  • Closed Accounts Posts: 1,723 ✭✭✭empirix


    Lads thanks for that info will give it a go when i get home.

    I'm not sure whether i get a boot command prompt in Grub(thats my problem), although its been a while and to say my knowledge of Linux now is hazy, is an understatement.
    Anyway thanks for the advice, its vmuch appreciated


  • Registered Users, Registered Users 2 Posts: 95 ✭✭fractal


    You do indeed get a boot command promt in Grub...

    When you get to the grub menu just hit 'e' and it will allow you to edit the command line of the currently select kernel..

    Also if the 'single' parameter doesnt work you can try.. passing 'init=1' to the kernel too.. That should also give you single user mode..

    Happy cracking.. :)


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Hi,
    'init=1' will fail, but just because it's two ideas run together.
    Press 'e' to get to edit mode on the line, and add just the number 1.
    This requests a boot to runlevel 1.
    That might still ask for a password.
    If it does, start again and type in init=/bin/bash
    This will give you a prompt with no password.

    It'll also leave your root partition mounted readonly so you can't do anything.
    You can get around this by typing
    mount -n -o remount,rw /
    (The -n means don't try to update the mtab file - it can't yet)

    Now try to edit /etc/shadow with your favourite editor,
    you should get in.
    Remove everything between the first two colons after the word root (i.e. root::blah:blah)
    Type sync a few times before logging out.
    You're running bash instead of init, so there's nothing to shut down the system cleanly.

    Best of luck,
    NiallB


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,581 Mod ✭✭✭✭Capt'n Midnight


    This wouldn't have happened if you had used windows.

    Let that be a warning to you !


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Ever gone through the procedure for recovering a lost
    Windows administrator password?


  • Closed Accounts Posts: 1,723 ✭✭✭empirix


    This worked below: cheers for everything lads!

    Originally posted by niallb
    Hi,
    'init=1' will fail, but just because it's two ideas run together.
    Press 'e' to get to edit mode on the line, and add just the number 1.
    This requests a boot to runlevel 1.
    That might still ask for a password.
    If it does, start again and type in init=/bin/bash
    This will give you a prompt with no password.

    It'll also leave your root partition mounted readonly so you can't do anything.
    You can get around this by typing
    mount -n -o remount,rw /
    (The -n means don't try to update the mtab file - it can't yet)

    Now try to edit /etc/shadow with your favourite editor,
    you should get in.
    Remove everything between the first two colons after the word root (i.e. root::blah:blah)
    Type sync a few times before logging out.
    You're running bash instead of init, so there's nothing to shut down the system cleanly.

    Best of luck,
    NiallB


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,581 Mod ✭✭✭✭Capt'n Midnight


    Originally posted by niallb
    Ever gone through the procedure for recovering a lost
    Windows administrator password?
    Always wanted to try the one when you rename commandprompt.exe to defautlscreensavername.scr and wait 15 minutes for the logon screen saver to appear.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 273 ✭✭electrofelix


    Originally posted by niallb
    Ever gone through the procedure for recovering a lost
    Windows administrator password?

    grab the Change NT Password Utility from the net, burn to CD if you need the extra drivers. Reboot machine, insert CD and follow the screen instructions to reset the admin password or any other local account password.

    Reboot and wola! new password for Administrator account. Works for NT, 2K & XP.


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Exactly,
    Step 1) Reboot in linux


Advertisement