LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I simply forgot/lost some OS login passwords. Work-around on a multiboot? (https://www.linuxquestions.org/questions/linux-newbie-8/i-simply-forgot-lost-some-os-login-passwords-work-around-on-a-multiboot-4175528222/)

Bhakta Neal 12-14-2014 04:26 AM

I simply forgot/lost some OS login passwords. Work-around on a multiboot?
 
Aloha,
I run a multiboot Toshiba laptop
MSWin7/Kubuntu/Mint/...

I haven't used some of the OS's in some months, so I forgot or lost the passwords. Is there any way to work around this, even via another os? Is it possible to breach or to change my login & pwd from another os?

Head_on_a_Stick 12-14-2014 05:23 AM

When booting up your GNU/Linux distro's, press "e" at the GRUB menu and add `init=/bin/bash` at the end of the kernel line.
Press enter, then "b"

This will boot you into a password-less root shell, you can then run:
Code:

passwd <username>
To set your new password.
:)

Soadyheid 12-16-2014 06:07 AM

Quote:

When booting up your GNU/Linux distro's, press "e" at the GRUB menu and add `init=/bin/bash` at the end of the kernel line.
Press enter, then "b"

This will boot you into a password-less root shell, you can then run:
Code:

passwd <username>

To set your new password.
Are you sure??? So why bother setting a password at all if you can hack round it this easily? :scratch:

Play Bonny!

:hattip:

veerain 12-16-2014 11:09 AM

Quote:

Originally Posted by Soadyheid (Post 5285463)
Are you sure??? So why bother setting a password at all if you can hack round it this easily? :scratch:

Play Bonny!

:hattip:

If the linux installed in a plain partition then this is very much possible?

To avoid this you have to encrypt the partition or disable access to system with bios password and grub password; so that no one can bypass linux login authenication.

veerain 12-16-2014 11:11 AM

See http://www.openwall.com. It has some programs for extracting Windows passwords.

Head_on_a_Stick 12-17-2014 11:37 AM

Quote:

Originally Posted by Soadyheid (Post 5285463)
Are you sure??? So why bother setting a password at all if you can hack round it this easily? :scratch:

Play Bonny!

:hattip:

I'm positive -- I've just tried this with my Arch box & it worked.

Scary!

Bhakta Neal 12-28-2014 11:41 PM

I'm sorry to return so late.
The solution presented in #2 did not work for me. It leaves me at a blank black screen with a blinking cursor.
Anything else I can try?

vincix 12-29-2014 06:06 PM

Quote:

Originally Posted by Bhakta Neal (Post 5291791)
I'm sorry to return so late.
The solution presented in #2 did not work for me. It leaves me at a blank black screen with a blinking cursor.
Anything else I can try?

You might be doing something wrong. This is the classical solution of recovering the root password. You don't need to add the quotes too (I suppose that's obvious), just add init=/bin/bash with a space after the kernel line (you need to look it up, it's the one with vmlinuz, etc.)

Anyway, if that really doesn't work (though I simply doubt it as long as you're doing it correctly), you can also try a linux live cd. Boot the CD/memory stick, open a terminal, identify the OS's root partition (fdisk -l, for instance), mount it (# mount /dev/sdX /mnt/temp - "temp" needs to exist beforehand as far as I know) and then change the root to that partition:
Code:

# chroot /mnt/temp
Then just type passwd, change it and reboot. That's it.

Bhakta Neal 12-30-2014 02:02 AM

Ok then, thanks, here goes another try

Bhakta Neal 12-30-2014 02:13 AM

Interesting, I can not get it to work, no matter how meticulous I copy the command.

Bhakta Neal 12-30-2014 02:36 AM

I press E at grub.
I type "init=/bin/bash" at the end of the vmlinuz line, without quotes of course
Hitting Enter just returns
Hitting B makes a "b" in the text, not boot as #2 says
Exiting by instruction, "ctrl x", leaves me at a black frozen screen
The only way I can get control of my machine is by power button purge
What am I doing wrong?

vincix 12-30-2014 03:53 AM

Quote:

Originally Posted by Bhakta Neal (Post 5292417)
I press E at grub.
I type "init=/bin/bash" at the end of the vmlinuz line, without quotes of course
Hitting Enter just returns
Hitting B makes a "b" in the text, not boot as #2 says
Exiting by instruction, "ctrl x", leaves me at a black frozen screen
The only way I can get control of my machine is by power button purge
What am I doing wrong?

Of course, it might simply be an issue with your boot loader. I would strongly recommend you create a live cd/memory stick. On Ubuntu-based OSs this is very easy to do with a memory stick.

Download the ISO and then:

# dd if=/path/to/ubuntu.iso of=/dev/sdc (c or whatever letter your memory stick is) and that's it. Boot it and follow the instructions I've told you about earlier (changing root and so on).

On the other hand, you can also boot the other linux OS directly and change root from there. If you want to follow that path, I'll try to help you.

Head_on_a_Stick 12-30-2014 06:39 AM

Quote:

Originally Posted by Bhakta Neal (Post 5292417)
I press E at grub.
I type "init=/bin/bash" at the end of the vmlinuz line, without quotes of course
Hitting Enter just returns
Hitting B makes a "b" in the text, not boot as #2 says
Exiting by instruction, "ctrl x", leaves me at a black frozen screen
The only way I can get control of my machine is by power button purge
What am I doing wrong?

Sorry -- my mistake, you should use <Ctrl>+x rather than "b"

I haven't used GRUB in a while (thank $DEITY).

make install clean 12-30-2014 02:01 PM

Quote:

Originally Posted by Bhakta Neal (Post 5284369)
Aloha,
I run a multiboot Toshiba laptop
MSWin7/Kubuntu/Mint/...

I haven't used some of the OS's in some months, so I forgot or lost the passwords. Is there any way to work around this, even via another os? Is it possible to breach or to change my login & pwd from another os?

@ Bhakta Neal

The youtube video link below will show how to boot into runlevel 1 so you can reset the root password as directed by others above.


Quote:

Originally Posted by Soadyheid (Post 5285463)
Are you sure??? So why bother setting a password at all if you can hack round it this easily? :scratch:

Play Bonny!

:hattip:

The youtube video below also shows how to protect your system from those work-a-rounds hacks like init=/bin/bash and others...

Securing Linux Servers - Best Practices & Troubleshooting Learn at Networknuts


The person in the video has a india accent, but it is not very heavy and you can still understand him.

vincix 01-03-2015 08:44 AM

Listen, I think the easiest way, if you know the password for Kubuntu or for Mint, is to boot that Linux OS. So for instance if you know the root password for Kubuntu, then simply boot it, and in a terminal write:
$ sudo chroot /dev/sdX (where sdX is the root partition (/) for Mint)
Then you should be able to change the password by simply running # passwd

It's that easy, you don't need an external device to boot it.


All times are GMT -5. The time now is 10:40 AM.