LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   How could normal user obtain root password or change root password (http://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



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