Forums: Forgoing The Console Login! - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Forgoing The Console Login! Yeah that's correct, get your root passw

#1 User is offline   Zimmergren 

  • Master Sergeant
  • Icon
  • Group: Specialist
  • Posts: 486
  • Joined: 17-July 03

Posted 07 September 2003 - 05:33 AM

Hey. As I'm not all too good with this linux security stuff, I read the book "Linux Server Hacks" by Bob Flickenger. It's great for admins..

Now to the story, I read the book, and learned this:

If you (, a friend, or whatever) misplaced the root password, I'd say no worries.
If you've got consoleaccess and don't mind rebooting, you could try to login with single user mode.
Simplay, after hitting Ctrl+Alt+Del you wait for the POST, then pass the parameter "single" to the booting kernel. I.e. in an LILO promt:

LILO: linux single

On many systems, this will provide you with a root shell. But on some systems (RedHat for instance) you'll run into the emergencypropmpt..

"Give root passwoed for maintenance
(Or type Control-D for normal startup"

If you knew the root pass, you woudln't be here...
If you're lucky, the initscript will let you hit ^C to get you a root prompt.. But most init processes are smarter than that and will tracp the ^C.

Soo, again from the LILO start, you could do:

LILO: linux init=/bin/bash

This will tell the kernel to give you a shell. No passwords, no filesystemchecks and no starting environment... But a very quick new root prompt.

This will be mounted read only though, networking will be down and none of the usual deamons will be running.. Above all, DONT hit ^D or type Exit!
You little shell (and the kernel) constitutes the entire filesystem in this situation..
Now, if it's read-only what do you do?
Try this:

# mount -o remount,rw /

It will force the filesystem to be remounted as read-write ;)
You should now be able to type "passwd" to change the actual root password.

When the pass is reset, DO NOT REBOOT!
Since there's ni init running, there'sno process in place to safely taking the system down.
Quickest way to shutdown would be :

#mount -o remount,ro /

Now with the rootpartition readonly, you can confidently hit the Reset button, bring it up in single user mode and begin your actuall work ;)

Hope this helps =)
http://www.zimmergren.net

Formerly known as t0bban.
0

#2 User is offline   Travis 

  • Specialist
  • Icon
  • Group: Specialist
  • Posts: 2,101
  • Joined: 26-February 03

Posted 08 September 2003 - 06:25 AM

Great Tutorial :) I fixed linuc for you.
0

#3 User is offline   Zimmergren 

  • Master Sergeant
  • Icon
  • Group: Specialist
  • Posts: 486
  • Joined: 17-July 03

Posted 08 September 2003 - 07:14 AM

dissolutions, on Sep 8 2003, 02:25 PM, said:

Great Tutorial :) I fixed linuc for you.

Thanks.

I'll be more active here in the LInux forums nowforth, cause I'm reading the book "Linux Server Hacks". It got 100 tips in different stuff, mostly adminrelated.

But there' probably some goodies, like this one =)
http://www.zimmergren.net

Formerly known as t0bban.
0

#4 Guest_bri77_*

  • Group: Guests

Posted 10 September 2003 - 10:00 AM

agreed. i have the book also. im a noob and its a great read. though only partially through it. recommended.

bri77
0

#5 Guest_scooby_*

  • Group: Guests

Posted 10 September 2003 - 12:35 PM

you can always password protect lilo in linuxconf to prevent this.;)
0

#6 User is offline   Jeremy 

  • Commander in Chief
  • Icon
  • Group: Admin
  • Posts: 2,345
  • Joined: 14-May 03

Posted 10 September 2003 - 01:58 PM

Quote

you can always password protect lilo in linuxconf to prevent this
smartass :P
Then all you do is make a new Lilo boot disk on a different computer and bypass that lilo install.... provided you can boot from CD or floppy first, or have BIOS password
Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma � which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.
~Steve Jobs

Jeremy aka w00dy aka foadah
0

#7 Guest_Hexboy_*

  • Group: Guests

Posted 11 September 2003 - 09:21 PM

Yeah,but you gotta remember its a never ending cycle of getting past one password and putting a new safeguard on :P Nice lilo tips nonetheless
0

#8 Guest_scooby_*

  • Group: Guests

Posted 11 September 2003 - 09:27 PM

Quote

provided you can boot from CD or floppy first, or have BIOS password

:D :D
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting