[TriLUG] root access

Corey Mutter mutterc at nc.rr.com
Fri Oct 3 23:25:53 EDT 2003


On Mon, Sep 22, 2003 at 09:12:33AM -0400, Stephen Hoffman wrote:
> Boot into single user mode, you'll be logged in as root automatically and
> you can issue passwd.  to do it from grub edit your boot line so that at
> the end of the first line you add "single".  For Lilo, from the prompt
> type "linux single" and you'll go into single user (init 1) and modify tha
> password.  As for being hacked, if you had a simple password, its always
> possible, but once you are in with root access again, check your logs,
> check  "last | more" to see if any logins were recorded at times you were
> sleeping or away.

Many distros will still ask for the root password when you boot in single-
user mode.

If this happens to you, try the following (this won't ask for any passwords):

- Boot with "init=/bin/sh" on the command line (where you would enter
"single"). 
- You'll get a prompt, but the root filesystem is still read-only. Make
it read-write with the following incantation:

mount -n -o remount,rw /dev/XXXX /
(where /dev/XXXX is replaced with your root device (often /dev/hda1)).
- run "passwd root" and enter a new password.
- "umount /" and reboot (with the reboot command or just power-cycle, the
disk will be fine since / is "unmounted" (really remounted read-only)). 

Corey

> 
> HTH
> Steve
> 
> > my linux box went down after I had no power at my apt.. When i brought it
> > back up, the root password doesn't work.. is there any way to reset the
> > root
> > password without reinstalling the OS... I have an ordinary user that works
> > fine.. Is it a possible that I've been hacked?
> >
> >
> >   _____
> >
> > Sincerely,
> > Jamil Hassan Spain
> > NC School of Science and Mathematics | External Programs
> > Phone: 919-416-2641
> > Web: www.dlt.ncssm.edu <http://www.dlt.ncssm.edu/>
> > Email: spain at ncssm.edu <mailto:spain at ncssm.edu>
> >   _____
> >
> >
> >
> > --
> > TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
> >
> 
> -- 
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20031003/2adef9e8/attachment.pgp>


More information about the TriLUG mailing list