Re: problem with corrupted root password

2015-01-15 Thread Jean-Marc
Hi the list,

Wed, 14 Jan 2015 17:51:35 -0700
Bob Proulx b...@proulx.com wrote :

 Did you get added to the sudo group?  If you are lucky then you did
 and you can use your own password instead of root.
 
   $ sudo passwd root
   $ su -
   #

Indeed, it is the easiest way.

 [...]
   $ sudo -l

Using this, you will know what you can do.

Some times ago, I read an interesting article about reseting root password:
http://www.iodigitalsec.com/reset-linux-root-password/

You can first try to stop the bootloader in its initial phase and pass /bin/sh 
as initial program instead of /sbin/init or /bin/systemd.

This allows to boot and get full rights to your system.

Nice if you have no Rescue CD.

 
 Bob


Jean-Marc jean-m...@6jf.be


pgpVnBGLCUs_J.pgp
Description: PGP signature


Re: problem with corrupted root password

2015-01-15 Thread Rob Owens
On Thu, Jan 15, 2015 at 12:47:08PM +0100, mrr wrote:
 On 15/01/2015 01:00, Gary Dale wrote:
 On 14/01/15 04:26 PM, Rob Owens wrote:
 On Wed, Jan 14, 2015 at 03:07:09PM -0500, Comer Duncan wrote:
 I recently got wheezy up and running.  I installed xfce4 and like it.
 
 However, today in the process of trying to spawn a root terminal (in
 Accessories) and going through a cycle of trying to get authorized but
 being prevented by repeated complaints that the system password I
 used was
 not correct, I now find that I can not get logged in in single-user
 mode!
 I have thus royally screwed up.  So, how can I get the system password
 changed to something new?
 
 Thanks for help and apologies for making such an error.
 Boot using a Live CD, then as root:
 
 mount /dev/sda1 /mnt/sda1 (or whatever device is your root partition)
 chroot /mnt/sda1
 passwd
 I'd change the chroot command to
chroot /mnt/sda1 bash
 
 to ensure you get the correct shell. System Rescue CD, for example, uses
 zsh by default so chrooting with specifying the shell will get you a
 not-found error.
 
 
 
 Wouldn't it work too if you delete the root line in /etc/shadow ?
 When I say delete, I mean just the hash, you would leave a line:
 
 root:
 
I tried this with a test user and it worked.  But there are fields after
the password hash that remain.  My user's line in /etc/shadow looked like 
this:

junk::16450:0:9:7:::

I was able to login as the 'junk' user without a password.  I wasn't
even asked for a password.  However, 'su junk' from my regular user
account did not work.

 And just for fun (well maybe I'll try this later) if you take your
 user hash in the same file and copy it in the place of the root
 hash, wouldn't root get the same password as the user one?
 
I tested this too, and it worked for both a login and for su.

Thanks for the ideas!

-Rob


signature.asc
Description: Digital signature


Re: problem with corrupted root password

2015-01-15 Thread mrr

On 15/01/2015 01:00, Gary Dale wrote:

On 14/01/15 04:26 PM, Rob Owens wrote:

On Wed, Jan 14, 2015 at 03:07:09PM -0500, Comer Duncan wrote:

I recently got wheezy up and running.  I installed xfce4 and like it.

However, today in the process of trying to spawn a root terminal (in
Accessories) and going through a cycle of trying to get authorized but
being prevented by repeated complaints that the system password I
used was
not correct, I now find that I can not get logged in in single-user
mode!
I have thus royally screwed up.  So, how can I get the system password
changed to something new?

Thanks for help and apologies for making such an error.

Boot using a Live CD, then as root:

mount /dev/sda1 /mnt/sda1 (or whatever device is your root partition)
chroot /mnt/sda1
passwd

I'd change the chroot command to
   chroot /mnt/sda1 bash

to ensure you get the correct shell. System Rescue CD, for example, uses
zsh by default so chrooting with specifying the shell will get you a
not-found error.




Wouldn't it work too if you delete the root line in /etc/shadow ?
When I say delete, I mean just the hash, you would leave a line:

root:

And just for fun (well maybe I'll try this later) if you take your user 
hash in the same file and copy it in the place of the root hash, 
wouldn't root get the same password as the user one?


All this from a boot cd of course!

--
mrr


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/54b7a8bd$0$2316$426a7...@news.free.fr



Re: problem with corrupted root password

2015-01-14 Thread Rob Owens
On Wed, Jan 14, 2015 at 03:07:09PM -0500, Comer Duncan wrote:
 I recently got wheezy up and running.  I installed xfce4 and like it.
 
 However, today in the process of trying to spawn a root terminal (in
 Accessories) and going through a cycle of trying to get authorized but
 being prevented by repeated complaints that the system password I used was
 not correct, I now find that I can not get logged in in single-user mode!
 I have thus royally screwed up.  So, how can I get the system password
 changed to something new?
 
 Thanks for help and apologies for making such an error.

Boot using a Live CD, then as root:

mount /dev/sda1 /mnt/sda1 (or whatever device is your root partition)
chroot /mnt/sda1
passwd 


signature.asc
Description: Digital signature


Re: problem with corrupted root password

2015-01-14 Thread Bob Proulx
Comer Duncan wrote:
 However, today in the process of trying to spawn a root terminal (in
 Accessories) and going through a cycle of trying to get authorized but
 being prevented by repeated complaints that the system password I used was
 not correct, I now find that I can not get logged in in single-user mode!
 I have thus royally screwed up.  So, how can I get the system password
 changed to something new?

Did you get added to the sudo group?  If you are lucky then you did
and you can use your own password instead of root.

  $ sudo passwd root
  $ su -
  #

Worth a try.  Remember that sudo asks for your password not root's
password.  Also you can use sudo to list what sudo actions are
available to you.

  $ sudo -l

Bob


signature.asc
Description: Digital signature


Re: problem with corrupted root password

2015-01-14 Thread Gary Dale

On 14/01/15 04:26 PM, Rob Owens wrote:

On Wed, Jan 14, 2015 at 03:07:09PM -0500, Comer Duncan wrote:

I recently got wheezy up and running.  I installed xfce4 and like it.

However, today in the process of trying to spawn a root terminal (in
Accessories) and going through a cycle of trying to get authorized but
being prevented by repeated complaints that the system password I used was
not correct, I now find that I can not get logged in in single-user mode!
I have thus royally screwed up.  So, how can I get the system password
changed to something new?

Thanks for help and apologies for making such an error.

Boot using a Live CD, then as root:

mount /dev/sda1 /mnt/sda1 (or whatever device is your root partition)
chroot /mnt/sda1
passwd

I'd change the chroot command to
  chroot /mnt/sda1 bash

to ensure you get the correct shell. System Rescue CD, for example, uses 
zsh by default so chrooting with specifying the shell will get you a 
not-found error.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/54b6f53e.60...@torfree.net