LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2015, 12:23 AM   #1
User0x45
Member
 
Registered: Jul 2008
Location: Berkeley, CA
Distribution: Slackware 12.1
Posts: 35

Rep: Reputation: 16
Recovering a five year old slack box


Hello,

I just booted an ancient slack box. "Ancient" means about 2008 or so.

It has root and one user account.

I can't remember either password. Any tips?

Back in the day....I could boot a cd, mount the drive, rm a particular file, and somehow get prompt to create a different password.

How to I go about recovering this box nowadays?
 
Old 08-16-2015, 01:01 AM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
the same method can be used
boot using CD/DVD, mount the root partition and chroot into it
from there, you can change the root's password
 
1 members found this post helpful.
Old 08-16-2015, 04:59 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,491

Rep: Reputation: Disabled
Boot to single user mode(?).
 
Old 08-16-2015, 07:22 AM   #4
chemfire
Member
 
Registered: Sep 2012
Posts: 422

Rep: Reputation: Disabled
I assume the box boots with Lilo? If the timeout is long enough that you can interrupt it. Just type the name of the boot entry you want probably 'Slackware' and you can pass the additional command argument

init=/bin/bash

That should drop you to a root prompt where you can use passwd to reset the root password. After that I would do

sync && sleep 1 && reboot

This might get a little more complex if the system uses an initrd, in which case willysr's method is probably your path of least resistance.
 
2 members found this post helpful.
Old 08-16-2015, 05:32 PM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by chemfire View Post
I assume the box boots with Lilo? If the timeout is long enough that you can interrupt it. Just type the name of the boot entry you want probably 'Slackware' and you can pass the additional command argument

init=/bin/bash

That should drop you to a root prompt where you can use passwd to reset the root password. After that I would do

sync && sleep 1 && reboot

This might get a little more complex if the system uses an initrd, in which case willysr's method is probably your path of least resistance.
I know if someone has physical access to a machine, the game is lost, but is there a way to prevent someone from using this specific method to reset the root password other than removing the prompt, making the time selection ridiculously small, or encrypting the drive?

I'd rather someone need to boot off something other than my harddrive to gain access to the system.
 
Old 08-16-2015, 06:00 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Set a BIOS password. The link below gives a basic explanation and googling it will give you a lot of hits. Might be able to find one for your specific hardware.

http://www.howtogeek.com/186235/how-...uefi-password/
 
Old 08-16-2015, 06:24 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by yancek View Post
Set a BIOS password. The link below gives a basic explanation and googling it will give you a lot of hits. Might be able to find one for your specific hardware.

http://www.howtogeek.com/186235/how-...uefi-password/
I'm not looking to prevent people from booting my machine (I want it to restart automatically after a power loss), but I would rather they not be able to run a bash prompt just by adding something to the init line. Just wondering if there's a way to prevent that.
 
Old 08-16-2015, 11:50 PM   #8
User0x45
Member
 
Registered: Jul 2008
Location: Berkeley, CA
Distribution: Slackware 12.1
Posts: 35

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by chemfire View Post
I assume the box boots with Lilo?
It does have Lilo, I'll give it a try.
 
Old 08-17-2015, 10:56 AM   #9
chemfire
Member
 
Registered: Sep 2012
Posts: 422

Rep: Reputation: Disabled
bassmadrigal + yancek

A bios password in my opinion isn't much additional security on a typical desktop / laptop. Anyone can still pop the disk in another system and fixup the password. The only real way to protect the thing is will full disk encryption. There are plenty of Slackware HOWTO's on that so I won't get into it here. Naturally this will prevent someone who does not have the unlock code or hardware token (USB stick usually) from booting too. Personally I would not skip encryption on anything portable.

In the case where you can physically secure the hardware IE like a kiosk where the computer is in a locked case or a PC-over-ip type situation a bios password + a 0 lilo timeout will prevent someone from interrupting the boot process and passing parameters. I'd also use disk encryption there. I these case you are depending on the security of the lock box or the VM environment obviously.
 
Old 08-17-2015, 11:38 AM   #10
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by bassmadrigal View Post
I'm not looking to prevent people from booting my machine (I want it to restart automatically after a power loss), but I would rather they not be able to run a bash prompt just by adding something to the init line. Just wondering if there's a way to prevent that.
I have not tried this, but this link leads me to believe that lilo does support password locking of the prompt, individual operating systems, or both together.

http://www.brunolinux.com/05-Configu...tect_Lilo.html

It's listed in the man page also.
 
3 members found this post helpful.
Old 08-17-2015, 12:38 PM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by chemfire View Post
bassmadrigal + yancek

A bios password in my opinion isn't much additional security on a typical desktop / laptop. Anyone can still pop the disk in another system and fixup the password. The only real way to protect the thing is will full disk encryption. There are plenty of Slackware HOWTO's on that so I won't get into it here. Naturally this will prevent someone who does not have the unlock code or hardware token (USB stick usually) from booting too. Personally I would not skip encryption on anything portable.

In the case where you can physically secure the hardware IE like a kiosk where the computer is in a locked case or a PC-over-ip type situation a bios password + a 0 lilo timeout will prevent someone from interrupting the boot process and passing parameters. I'd also use disk encryption there. I these case you are depending on the security of the lock box or the VM environment obviously.
I totally agree that password protecting the bios is usually worthless. I was mainly looking to prevent someone from just sitting at my machine and modifying the boot parameters of lilo to get a root prompt (not that I would likely run into anyone attempting this). It looks like mralk3's link will do just that.

Quote:
Originally Posted by mralk3 View Post
I have not tried this, but this link leads me to believe that lilo does support password locking of the prompt, individual operating systems, or both together.

http://www.brunolinux.com/05-Configu...tect_Lilo.html

It's listed in the man page also.
That is great! I never even thought to look for this, because I never realized you could so easily bypass the root password just by rebooting and changing the boot parameters (I always figured it required booting off installation/rescue media).

It looks like I can just specify a global password, and then add restricted under each boot entry, and then you will only be prompted for the password if you attempt to add anything to the boot parameters.

I've been using lilo for well over a decade, and people still help me find new stuff...
 
  


Reply



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
Slack 13.37 x86_64 - OK for over a year, but suddenly can't boot. Hardware? geep999 Slackware 4 08-15-2012 11:55 AM
LXer: No, a 16-year-old Sun Sparcstation doesn’t work like a new x86 box LXer Syndicated Linux News 0 04-12-2011 02:40 AM
sharing an internet connection on a slack/winxp box with a winxp box The_spacekadet Linux - Newbie 6 03-09-2008 09:31 AM
Recovering GRUB on dual boot XP/RH box ericcarlson Linux - Software 2 06-05-2007 07:55 PM
Recovering Slack After Power Failure.. sxa Slackware 12 03-06-2004 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:00 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
Open Source Consulting | Domain Registration