LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How could normal user obtain root password or change root password (https://www.linuxquestions.org/questions/debian-26/how-could-normal-user-obtain-root-password-or-change-root-password-361680/)

ckamheng 09-09-2005 02:54 AM

How could normal user obtain root password or change root password
 
well, i am running Debian as a normal user.
i need to obtain root password so that i can mount my Win XP drive and make new directory, shuting down my system.....etc.

Anyway i can obtain the root password or change the root password. I heard i may do it in single user mode.

1. edit the inittab file, make the default run level as single user mode, which is 1.
2. press the hardware button, shutdown the pc ....
3. turn on the pc again..
4. it will enter the single user mode
5. type passwd command on the shell, and change the root password...

Is this way workable?????????
Please advice..Thanks...

acid_kewpie 09-09-2005 03:00 AM

yeah that'll work. bit overkill though, don't edit inittab, instead just temporarily add "1" to the boot command in lilo or grub when it loads up.

ckamheng 09-09-2005 03:07 AM

How to edit the lilo file by adding "1" to the boot command...can anyone show me the sample lilo file ???

btw, why shouldn't i edit the inittab file??
i will change it back to multiuser mode once the root password is changed successfully.

Please advice. thanks.

acid_kewpie 09-09-2005 03:13 AM

no, you don't edit enything permanently, just hit x or whatever in lilo to edit it instantly.

ckamheng 09-09-2005 03:15 AM

oh no........
normal user won't be able to edit inittab and lilo.conf.......

please advice....

ckamheng 09-09-2005 03:25 AM

am i asking a stupid question here...
hahaha....i think so....
sorry for that...

acid_kewpie 09-09-2005 03:58 AM

i've said twice now you don't edit ANY files... please read what i'm saying

jasem200 03-06-2007 07:05 AM

at lilo type
linux single
then u can boot as root without asking for a passwd, and u can change it then.

JimBass 03-06-2007 07:59 AM

Debian uses grub by default, not lilo. When the grub menu appears, hit "e" for edit, then add the runlevel you want.

Peace,
JimBass

rickh 03-06-2007 11:42 AM

I must not be understanding the question. It sounds to me like you want to somehow gain root privileges without knowing the current root password. Hopefully it's not nearly as simple as the suggestions above. I usually get to single user mode in Debian by typing "telinit 1" at a command prompt. But you still need the root password to go any further.

JimBass 03-06-2007 11:48 AM

You can always reset the root password with physical access to the box. You just boot into runlevel 1, which can only be blocked if you password protect your grub/lilo screen. Over a network, even a LAN you can't do anything without knowing the root pass, but it is trivially easy to get around if you can be there while it is booting.

Peace,
JimBass

rickh 03-06-2007 12:16 PM

I must be dense, but I can't figure out how to do it. I can boot to runlevel 1 (single user mode), no problem, but once there I have to enter the root password, or hit Control-D, which simply returns me to a normal boot sequence.

I will try again later today.

BillyGalbreath 03-06-2007 03:51 PM

With Debian you must supply the root password if you boot with "single" in GRUB. Instead, boot with "-s". This will bring up a shell before it brings up init. You can change your root password that way.

rickh 03-06-2007 04:38 PM

Quote:

Instead, boot with "-s"
Tried that, too ... Still wants my root password.

Tortanick 03-07-2007 03:18 AM

Nice to see that debian is secure against such easy attacks.

You could use a Live CD, log into the live CD as root, mount you're harddrive, chroot into the hard drive, then change you're password. If debian is installed on hda2

I think this would do it.
Code:

mount /dev/hda2 /mnt
chroot /mnt
passwd


rickh 03-07-2007 10:12 AM

Quote:

You could use a Live CD...
I know it could be done using a Live CD, but I'm uncomfortable with the idea that anyone who can reboot and see the Grub login screen could trivially gain root access. As I said, I have not been able to accomplish it, but if it can be done, on an up-to-date Debian (Etch) system, I want to know.

BillyGalbreath 03-14-2007 09:33 PM

I just now remembered because I had to do it... But I _knew_ there was a way to get into a Debian box from grub.. Instead of booting with 'single' or '-s' which asks for a password, boot with this:

Code:

init=/bin/bash
I was unable to change my password this time (I have brain farts often) because I could not remember how to remount / as writable... But once its up, just remount the root partition as writable and then run 'passwd' to change the password.

Simple.

handydan 02-18-2009 10:02 PM

root reset without single user mode
 
at the grub prompt, edit the boot option line to include

Code:

init=/bin/sh
Then do
Code:

mount -o remount,rw /
And then the point of the exercise....
Code:

passwd root
and
Code:

sync&&reboot

billymayday 02-18-2009 10:28 PM

Did you realize this was originally from 2005 and most recently from 2007?


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