LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2014, 05:26 AM   #1
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Rep: Reputation: 19
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?
 
Old 12-14-2014, 06:23 AM   #2
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
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.
 
Old 12-16-2014, 07:07 AM   #3
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.3 and 18 at present.
Posts: 1,192

Rep: Reputation: 204Reputation: 204Reputation: 204
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?

Play Bonny!

 
Old 12-16-2014, 12:09 PM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by Soadyheid View Post
Are you sure??? So why bother setting a password at all if you can hack round it this easily?

Play Bonny!

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.
 
Old 12-16-2014, 12:11 PM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
See http://www.openwall.com. It has some programs for extracting Windows passwords.
 
Old 12-17-2014, 12:37 PM   #6
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
Quote:
Originally Posted by Soadyheid View Post
Are you sure??? So why bother setting a password at all if you can hack round it this easily?

Play Bonny!

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

Scary!
 
Old 12-29-2014, 12:41 AM   #7
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
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?
 
Old 12-29-2014, 07:06 PM   #8
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 556

Rep: Reputation: 52
Quote:
Originally Posted by Bhakta Neal View Post
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.

Last edited by vincix; 12-29-2014 at 07:08 PM.
 
Old 12-30-2014, 03:02 AM   #9
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Ok then, thanks, here goes another try
 
Old 12-30-2014, 03:13 AM   #10
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Interesting, I can not get it to work, no matter how meticulous I copy the command.
 
Old 12-30-2014, 03:36 AM   #11
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
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?

Last edited by Bhakta Neal; 12-30-2014 at 03:40 AM.
 
Old 12-30-2014, 04:53 AM   #12
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 556

Rep: Reputation: 52
Quote:
Originally Posted by Bhakta Neal View Post
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.
 
Old 12-30-2014, 07:39 AM   #13
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
Quote:
Originally Posted by Bhakta Neal View Post
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).
 
Old 12-30-2014, 03:01 PM   #14
make install clean
LQ Newbie
 
Registered: Dec 2014
Posts: 11

Rep: Reputation: Disabled
Quote:
Originally Posted by Bhakta Neal View Post
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 View Post
Are you sure??? So why bother setting a password at all if you can hack round it this easily?

Play Bonny!

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.

Last edited by make install clean; 12-30-2014 at 03:28 PM.
 
Old 01-03-2015, 09:44 AM   #15
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 556

Rep: Reputation: 52
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lost / forgot user name Avedepreda Linux - Newbie 2 10-28-2013 02:18 PM
Remote ssh login (passwords useless), and local login (using password) linuxStudent11 Linux - Security 1 01-09-2013 02:30 PM
passwords lost fredbear Linux - Newbie 14 09-28-2009 07:06 PM
Suse and XP - lost multiboot GRUB bharath_neo SUSE / openSUSE 2 05-02-2007 03:49 AM


All times are GMT -5. The time now is 05:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration