LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-13-2004, 01:32 PM   #1
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Rep: Reputation: 15
forgot root password


The subject says it all. I don't know what I was thinking when I changed it but it has been so long since I have needed to log on I forgot it. The box is my Internet gateway which is why I don't really log on. Once I got it working I just left it on.
Anyways, is there a way to change the root password without reinstalling? I have it set up so perfectly and don't want to change anything.
I'd be fine and just let it run but I want to keep it updated.
Any ideas would be great.
Jeem
 
Old 01-13-2004, 01:35 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It depends on what bootloader you are using - you need to append " single" to your kernel arguments at boot - for grub:
1) Reboot your computer.
2) When the grub bootloader appears on the screen select the entry for your linux system - it may be the only one.
3) Press the "e" key to edit the entry.
4) Select the line beggining with "kernel".
5) Press the "e" key again
6) Type " single" no quotes
7) Press enter
8) Press "b" to boot
9) When the prompt appears type "passwd" press enter
10) Enter a new password when prompted
11) Reboot by typing "shutdown -r now"
 
Old 01-13-2004, 01:43 PM   #3
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Original Poster
Rep: Reputation: 15
Thanks. I use LILO and Slackware 9.1. Is the procedure similar?
It seems a little strange that anyone can just do this to change the root password. It doesn't seem very secure. Not that I have anything to worry about at home but how to places that require tight security stop this from happening. All I can think of is locked doors.
Jeem
 
Old 01-13-2004, 02:56 PM   #4
priest_judas
Member
 
Registered: Dec 2003
Distribution: Slackware 9.0
Posts: 32

Rep: Reputation: 15
Quote:
Originally posted by jeempc
Thanks. I use LILO and Slackware 9.1. Is the procedure similar?
It seems a little strange that anyone can just do this to change the root password. It doesn't seem very secure. Not that I have anything to worry about at home but how to places that require tight security stop this from happening. All I can think of is locked doors.
Jeem
yeap, I agree with you....
 
Old 01-13-2004, 08:29 PM   #5
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Original Poster
Rep: Reputation: 15
Figured it out

This is how I did it:

At the boot prompt type

linux init=/bin/bash

It will present you with a root shell(how convenient). Then type

# mount -o remount,rw /

That mounts the / partition read write so the passwd command will write to the /etc/passwd file

Then type the passwd command

# passwd

Then remount read only

# mount -o remount,ro /

Then ctrl-alt-del

I found the answer in a book called Linux Server Hacks by Rob Flickenger.
It is published by O'REILLY
 
Old 01-13-2004, 10:26 PM   #6
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Since it's possible to put a password into Grub (not sure about lilo.. I think you can.) and/or into your bios to boot the machine, i really don't find it all that insecure.

Besides, there would be other methods of obtaining access anyway... Booting from knoppix, for example...
Physical access is the least secure kind :-D
-Shade
 
Old 01-13-2004, 10:32 PM   #7
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Yeah, Once you have physical access to any machine running any OS all bets are off. Since you can always reset a BIOS, always replace a boot loader, and always boot with removable media.
 
Old 01-14-2004, 08:29 AM   #8
kadaver
Member
 
Registered: Nov 2003
Location: Beautiful Northern-sweden (Luleå)
Posts: 90

Rep: Reputation: 15
If you're concerned about someone hacking you beloved box, why do you use boot loaders?
Just remove the prompt option (no prompt=no ugly hacks) and keep a "single user bootdisk" hidden in case of emergency. Preferably where the sun don't shine =D.
Problem solved! =)
 
Old 01-14-2004, 08:41 AM   #9
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
As long as the would be hacker doesn't bring a knoppix Live CD, or his own bootdisk.....
 
Old 01-14-2004, 12:20 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Quote:
Originally posted by leonscape
As long as the would be hacker doesn't bring a knoppix Live CD, or his own bootdisk.....
With a BIOS password and a change to the boot order you can stop this.

It should be noted however that if you have access to a computer you can physically remove the hdd and mount the drive's partitions in another computer. You could look into encrypted filesystems if you have lots of sensitive data.
 
Old 01-14-2004, 12:54 PM   #11
nny0000
Member
 
Registered: Aug 2003
Distribution: Slackware, Ubuntu
Posts: 158

Rep: Reputation: 30
if your paranoid about physical access you could always lock up the box itself for added security. or buy a case that has a locking mechanism on it to lock up the drive bays. even though it is flimsy you will atleast know if someone attempted or acually got into your box because the lock will be broken. just make sure it covers the floppy drive too. Just an Idea.

A Slacker
 
Old 01-14-2004, 01:32 PM   #12
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Original Poster
Rep: Reputation: 15
Thanks for all those ideas. I figure if I have sensitive data I can just encrypt it with GPG.
My question is can you encrypt any kind of file with gpg -c filename ?
It makes sense with text but how about a MS Word document or a pdf. Can you encrypt binary files?
I am not personally worried about someone coming into my house but lets say I had nosey roommates and they had a boot cd.
In my scenario I thought I forgot the root password but maybe someone actually had access to my machine and changed it and that's why my password didn't work. It makes one wonder.
Speaking of BIOS passwords. I set a hard drive password on a hard drive I used in my laptop. Then my laptop motherboard fried. While the laptop was at Dell I forgot the hard drive password and they upgraded the bios. When I got it back my hard drive was usless.
Is there any way to bypass the hard-drive password now.
It really sucks because I lost 40 gigs of drive space and have to use my spare drive which is only 10 gigs.
Thanks again
Jeem
 
Old 01-26-2004, 10:27 PM   #13
jleybo
LQ Newbie
 
Registered: Mar 2003
Location: State College, PA US
Distribution: Slack 9.1
Posts: 5

Rep: Reputation: 0
Smile Re: Figured it out

Can't thank you enough for this bit of info. Saved me hours, I'm sure.

In my newbie attempt to upgrade from 8.1 to 9.1 I was intent on following the upgrade instructions exactly - and was replacing all the files that had *.new files in /etc. I got to the passwd.new file and mistakenly figured that my 8.1 boot disks would allow me to get back in if there was a problem (yes, I suspected there would be a problem and did it anyway).

I'm thinking I should leave the shadow- file alone. ;-)

Quote:
Originally posted by jeempc
This is how I did it:

At the boot prompt type

linux init=/bin/bash

It will present you with a root shell(how convenient). Then type

# mount -o remount,rw /

That mounts the / partition read write so the passwd command will write to the /etc/passwd file

Then type the passwd command

# passwd

Then remount read only

# mount -o remount,ro /

Then ctrl-alt-del

I found the answer in a book called Linux Server Hacks by Rob Flickenger.
It is published by O'REILLY
 
Old 02-07-2004, 10:03 PM   #14
LeniuNYC
LQ Newbie
 
Registered: Feb 2004
Location: new york
Posts: 27

Rep: Reputation: 15
locking doors to your apartment once in a while would help .
Imagine putting on a bios password, allowing booting on hdd only, and then someone breaking into your house and stealing your box. Wonder how would he sell it
 
Old 02-08-2004, 08:02 AM   #15
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
its not that hard to blank the comos chip so any passords for the bios will be killed, i hear it can be done with just a paperclip, so if you can, just 4get about passwords as there are a lot of way around them once you get local acess, i say bestcrypt looks good, no need to try and get a new FS runing
 
  


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
Forgot root password muru Linux - Security 5 09-26-2005 12:37 AM
forgot root password ali_hammad Linux - Newbie 3 03-09-2005 10:46 AM
forgot root password ali_hammad Linux - Security 4 03-08-2005 02:44 PM
Forgot root password Jay Smith Linux - Newbie 15 10-12-2004 06:23 PM
Forgot Root Password Ironpaws Linux - Software 6 07-03-2004 04:48 PM

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

All times are GMT -5. The time now is 08:46 AM.

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