Re: Recovering root password

2020-06-24 Thread Konstantin Olchanski
On Wed, Jun 24, 2020 at 09:36:58AM -0700, Konstantin Olchanski wrote:
> 
> Well, we do not have to tell them *all* of our secrets, do we?
> 

Funny, enough, just stumbled on this:

https://linux.web.cern.ch/centos8/docs/singleuser/

-- 
Konstantin Olchanski
Data Acquisition Systems: The Bytes Must Flow!
Email: olchansk-at-triumf-dot-ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada


Re: Recovering root password

2020-06-24 Thread Stephan Wiesand
> On 23. Jun 2020, at 21:25, Andrew C Aitchison  wrote:
> 
> On Tue, 23 Jun 2020, Konstantin Olchanski wrote:
> 
>> On Tue, Jun 23, 2020 at 10:49:48AM +0200, Elio Fabri wrote:
>>> Hi all,
>>> I need help (at lest a link) as to how to recover my root password.
>>> I'm using SL6.2. The password I remember by heart is no longer
>>> accepted, neither for the su command nor for sudo.
>>> Thx
>> 
>> While you cannot "recover" the root password, if you have physical access
>> to the machine, you can bypass it, login as root and reset the password:
>> remove the boot disk from problem machine, attach it to a 2nd computer,
>> mount the root partition, go to root/.ssh and install your ssh key. unmount,
>> reassemble problem computer, boot, ssh into root, done. While the boot disk
>> is mounted on the 2nd computer, in addition to installing the ssh key,
>> you can also reset the password (edit /etc/shadow) or setup "sudo" for
>> password-less "sudo root" (recent Ubuntu are setup this way, you never 
>> actually
>> use the root password to login into root).
> 
> If you remember the BIOS password, or never set one,
> you can boot from an install or rescue disk/memory stick,
> and do that "second computer" stuff without moving the
> disk to another machine.

It seems surprisingly little known that there's a *much* simpler and faster way.

1) In the boot loader, hit 'e' and add "init=/bin/sh" to the kernel 
commandline. If you set a boot loader password (and these instructions should 
make clear why you should), you'll obviously have to remember that. After boot, 
you'll get a root prompt but a r/o mounted /
2) remount -oremount,rw /
3) set the root passowrd with the passwd command
4) sync; remount -oremount,ro /
5) hit ctrl-alt-del to reboot

And if you don't have the SL_password_for_singleuser installed, which isn't the 
default I think, it's even easier: just add "1" to the kernel command line.

HTH,
- Stephan

Re: Recovering root password

2020-06-23 Thread Andrew C Aitchison

On Tue, 23 Jun 2020, Konstantin Olchanski wrote:


On Tue, Jun 23, 2020 at 10:49:48AM +0200, Elio Fabri wrote:

Hi all,
I need help (at lest a link) as to how to recover my root password.
I'm using SL6.2. The password I remember by heart is no longer
accepted, neither for the su command nor for sudo.
Thx


While you cannot "recover" the root password, if you have physical access
to the machine, you can bypass it, login as root and reset the password:
remove the boot disk from problem machine, attach it to a 2nd computer,
mount the root partition, go to root/.ssh and install your ssh key. unmount,
reassemble problem computer, boot, ssh into root, done. While the boot disk
is mounted on the 2nd computer, in addition to installing the ssh key,
you can also reset the password (edit /etc/shadow) or setup "sudo" for
password-less "sudo root" (recent Ubuntu are setup this way, you never actually
use the root password to login into root).


If you remember the BIOS password, or never set one,
you can boot from an install or rescue disk/memory stick,
and do that "second computer" stuff without moving the
disk to another machine.


--
Andrew C. Aitchison Kendal, UK
and...@aitchison.me.uk


Re: Recovering root password

2020-06-23 Thread Jon Pruente
On Tue, Jun 23, 2020 at 3:50 AM Elio Fabri  wrote:

> Hi all,
> I need help (at lest a link) as to how to recover my root password.
> I'm using SL6.2. The password I remember by heart is no longer accepted,
> neither for the su command nor for sudo.
> Thx
> --
> Elio Fabri
>

The password for sudo should be your user password, not root.


Re: Recovering root password

2020-06-23 Thread Andrew Z
Or, if you have a lot of time, you can look i to "jack the ripper" . I had
similar situation earlier this month (forgot my pass).
Full dosclosure- After 5hours of reading and configuring it to crack my
pass, i gave up and reset it(pass).

On Tue, Jun 23, 2020, 10:35 Konstantin Olchanski  wrote:

> On Tue, Jun 23, 2020 at 10:49:48AM +0200, Elio Fabri wrote:
> > Hi all,
> > I need help (at lest a link) as to how to recover my root password.
> > I'm using SL6.2. The password I remember by heart is no longer
> > accepted, neither for the su command nor for sudo.
> > Thx
>
> While you cannot "recover" the root password, if you have physical access
> to the machine, you can bypass it, login as root and reset the password:
> remove the boot disk from problem machine, attach it to a 2nd computer,
> mount the root partition, go to root/.ssh and install your ssh key.
> unmount,
> reassemble problem computer, boot, ssh into root, done. While the boot disk
> is mounted on the 2nd computer, in addition to installing the ssh key,
> you can also reset the password (edit /etc/shadow) or setup "sudo" for
> password-less "sudo root" (recent Ubuntu are setup this way, you never
> actually
> use the root password to login into root).
>
> --
> Konstantin Olchanski
> Data Acquisition Systems: The Bytes Must Flow!
> Email: olchansk-at-triumf-dot-ca
> Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada
>


Re: Recovering root password

2020-06-23 Thread Konstantin Olchanski
On Tue, Jun 23, 2020 at 10:49:48AM +0200, Elio Fabri wrote:
> Hi all,
> I need help (at lest a link) as to how to recover my root password.
> I'm using SL6.2. The password I remember by heart is no longer
> accepted, neither for the su command nor for sudo.
> Thx

While you cannot "recover" the root password, if you have physical access
to the machine, you can bypass it, login as root and reset the password:
remove the boot disk from problem machine, attach it to a 2nd computer,
mount the root partition, go to root/.ssh and install your ssh key. unmount,
reassemble problem computer, boot, ssh into root, done. While the boot disk
is mounted on the 2nd computer, in addition to installing the ssh key,
you can also reset the password (edit /etc/shadow) or setup "sudo" for
password-less "sudo root" (recent Ubuntu are setup this way, you never actually
use the root password to login into root).

-- 
Konstantin Olchanski
Data Acquisition Systems: The Bytes Must Flow!
Email: olchansk-at-triumf-dot-ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada


RE: Recovering root password

2020-06-23 Thread Eremey Valetov
It may be possible to reset the root password by booting into single user 
mode, something like this:
https://wiki.centos.org/TipsAndTricks/ResetRootPassword

-- Eremey

-Original Message-
From: owner-scientific-linux-us...@listserv.fnal.gov 
 On Behalf Of Elio Fabri
Sent: Tuesday, June 23, 2020 3:50
To: 'scientific-linux-users@fnal.gov' 
Subject: Recovering root password

Hi all,
I need help (at lest a link) as to how to recover my root password.
I'm using SL6.2. The password I remember by heart is no longer accepted, 
neither for the su command nor for sudo.
Thx
--
Elio Fabri


smime.p7s
Description: S/MIME cryptographic signature