вт, 17 янв. 2023 г. в 11:01, David <david.g_jones@ntlworld.com>:
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
You can't.
But you can set new password, if you boot from live-usb/live-cd, mount
your system to dir and run `chroot dir && passwd $user`
--
Stanislav
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
??, 17 ???. 2023 ?. ? 11:01, David <david.g_jones@ntlworld.com>:
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
You can't.
But you can set new password, if you boot from live-usb/live-cd, mount
your system to dir and run `chroot dir && passwd $user`
??, 17 ???. 2023 ?. ? 11:01, David <david.g_jones@ntlworld.com>:
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
You can't.
But you can set new password, if you boot from live-usb/live-cd, mount
your system to dir and run `chroot dir && passwd $user`
One other thing you can do if you don't have a quick and easy way to
boot is to manually replace the hash in /etc/shadow with one that you do
know the password for. (This might be the case, for example, where the
USB stick is for booting ARM but all your other machines are x86, mount, >change password, umount is much quicker than trying to work out how to
live boot a headless arm system...)
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list?
On Tue, 17 Jan 2023, Stanislav Vlasov wrote:
??, 17 ???. 2023 ?. ? 11:01, David <david.g_jones@ntlworld.com>:
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in
/etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can
I
read this string?
You can't.
But you can set new password, if you boot from live-usb/live-cd, mount
your system to dir and run `chroot dir && passwd $user`
One other thing you can do if you don't have a quick and easy way to
boot is to manually replace the hash in /etc/shadow with one that you
do
know the password for. (This might be the case, for example, where the
USB stick is for booting ARM but all your other machines are x86,
mount,
change password, umount is much quicker than trying to work out how to
live boot a headless arm system...)
This is something I did in ancient times when most systems still used
crypt and the system I was having problems with was the only one (so
far) that had been converted to use SHA? hashes. I replaced root's
hash,
which I'd forgotten with that of my user account, which I did know.
And if you don't have any hashes that you know the password for then
ask
here, someone can generate one for you - or see this thread:
https://unix.stackexchange.com/questions/81240/manually-generate-password-for-etc-shadow
Obviously manually editing these files isn't something to be done
without care. I always have backups so worst case is "restore from
backup" and not "I've lost everything"
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
вт, 17 янв. 2023 г. в 11:01, David <david.g_jones@ntlworld.com>:
Looking on the internet it says the passwords are stored in
/etc/passwd and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way
calculated from password string.
The password string in /etc/shadow looks as if it's encoded, how
can I read this string?
You can't.Everyone (and their friend) seem to know, how to work around this,
which apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Everyone (and their friend) seem to know, how to work around this, which apparently is common debian knowledge (which is nice).This is not hacking. How to reset password on your computer is the is
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
вт, 17 янв. 2023 г. в 11:01, David <david.g_jones@ntlworld.com>:Everyone (and their friend) seem to know, how to work around this,
Looking on the internet it says the passwords are stored in
/etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can
I
read this string?
You can't.
which
apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
just my 2 cents
DdB
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
вт, 17 янв. 2023 г. в 11:01, David <david.g_jones@ntlworld.com>:
Looking on the internet it says the passwords are stored in
/etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way
calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how
can I
read this string?
You can't.Everyone (and their friend) seem to know, how to work around this,
which
apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to
teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
Everyone (and their friend) seem to know, how to work around this,
which
apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to
teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Everyone (and their friend) seem to know, how to work around this, which apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Morning All,
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
David.
Hello
On 2023-01-17 09:51, DdB wrote:
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
??, 17 ???. 2023 ?. ? 11:01, David <david.g_jones@ntlworld.com>:Everyone (and their friend) seem to know, how to work around this, which apparently is common debian knowledge (which is nice).
Looking on the internet it says the passwords are stored in /etc/passwd >>> and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can I >>> read this string?
You can't.
But somehow, i feel there could be more caring about avoiding to teach future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
just my 2 cents
DdB
It's not hacking. It's typical administration system stuff. A required knowledge so you don't end up locked out of your own system in non-encypted installation. It requires physical access to the computer, so applicable from distance as you need to either
- remove then mount the hard drive on another machine.
- boot from a live USB.
- boot into GRUB's rescue-shell.
But if you're worried about physical access to your computer (as a laptop than
can be easily stolen, or left in hotel room, or whatever), an account password
isn't going to protect your data or from someone alter your password /install fishy stuff?
In such case, you need to protect your system by encrypt it. And not just encrypt /home as the files you need to protect in order to protect the system from password tampering are NOT in /home. Debian installer has an option to encrypt the system quite easily, you just need time for the initial installation is it spends an good amount of writing random data (m?re or less acceptable duration depending on your disk speed and CPU performance). And re-ecrypt it when needed/when algorithmes get broken and new better ones become the new recommended standard/if your decryption passphrase is known by someone else/whatever.
But it only makes sense of your decryption key has a long complex passphase. An easily brute-forceable or guessable password for disk encryption defeats the very own purpose of disk encryption. It basically means if you forget the passphrase, you're pretty much screwed until you either remembrer it, or reinstall and reconfigure everything. so you need to have backup [1] in secure
place.
---
1. But again, backups are required anyway, encrypted installs or not. Storage support do fail and/or get stolen. Never trust a single storage device. Or a "cloud" backup bullshit. Cloud being nothing else than someone's else computer
who can do whatever they want on it, kick users whenever they please or abuse personal data for profit if they want to (whether they do it in a "legal" or semi-legal way or not doesn't matter. As they have the technical means to do so and users have no means to check what's going on [2]. Including when data is "encrypted" IF encryption and decryption happens on their systems).
2. It's already hard enough to know what's going on on one's own computer, let
alone distant systems managed by someone else?
You don't need a live-usb/cd.
If your boot system is grub you only have to change command to exec=/bin/bash
Once you are in your system you can change root password and others.
Easier would be to delete the second field in /etc/shadow for root, so there won't be anymore root password (it's empty). You can then create one with the 'passwd' command.
Le 17-01-2023, à 07:19:04 -0500, Greg Wooledge a écrit :
On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote:
Easier would be to delete the second field in /etc/shadow for root, so there
won't be anymore root password (it's empty). You can then create one with the
'passwd' command.
If you can edit the /etc/shadow file, you're already root, which means
you can simply run "passwd root" to set a new password. You will not
be prompted for the old password, so there's no need to clear the old password hash preemptively.
You're right if you're editing the file in the OS, but not if you have accessed data from a live-cd, which was what I was thinking. Sorry.
Le 17-01-2023, 07:19:04 -0500, Greg Wooledge a crit :
On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote:
Easier would be to delete the second field in /etc/shadow for root, so there
won't be anymore root password (it's empty). You can then create one with the
'passwd' command.
If you can edit the /etc/shadow file, you're already root, which means
you can simply run "passwd root" to set a new password. You will not
be prompted for the old password, so there's no need to clear the old password hash preemptively.
You're right if you're editing the file in the OS, but not if you have accessed data from a live-cd, which was what I was thinking. Sorry.
On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote:
Easier would be to delete the second field in /etc/shadow for root, so there >> won't be anymore root password (it's empty). You can then create one with the
'passwd' command.
If you can edit the /etc/shadow file, you're already root, which means
you can simply run "passwd root" to set a new password. You will not
be prompted for the old password, so there's no need to clear the old >password hash preemptively.
On Tue, Jan 17, 2023 at 01:53:33PM +0100, steve wrote:
Le 17-01-2023, à 07:19:04 -0500, Greg Wooledge a écrit :
On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote:
Easier would be to delete the second field in /etc/shadow for root, so there
won't be anymore root password (it's empty). You can then create one with the
'passwd' command.
If you can edit the /etc/shadow file, you're already root, which means
you can simply run "passwd root" to set a new password. You will not
be prompted for the old password, so there's no need to clear the old
password hash preemptively.
You're right if you're editing the file in the OS, but not if you have
accessed data from a live-cd, which was what I was thinking. Sorry.
If you went in via a Live CD, and mounted the Debian root partition,
the next step is to chroot into the Debian root partition. Then you
can run "passwd root" in the chroot shell. Then exit from the shell,
and unmount the Debian partition.
Of course, your way (which I'm assuming is "mount the Debian root
partition, edit the /debian/etc/shadow file to clear the hash, unmount
it, reboot into Debian, login as root with no password, and run "passwd") >also works, but it's a bit more effort.
Le 17-01-2023, à 08:07:02 -0500, Greg Wooledge a écrit :
On Tue, Jan 17, 2023 at 01:53:33PM +0100, steve wrote:
Le 17-01-2023, à 07:19:04 -0500, Greg Wooledge a écrit :
If you went in via a Live CD, and mounted the Debian root partition,
the next step is to chroot into the Debian root partition [...]
chroot can be tricky for newcommers…
Le 17-01-2023, à 15:05:37 +0100, tomas@tuxteam.de a écrit :
chroot can be tricky for newcommers…
That's why passwd is nice to us and has the -R option :)
Thanks Tomas, didn't know that option. Will go to bed a bit less stupid tonight :-)
chroot can be tricky for newcommers…
That's why passwd is nice to us and has the -R option :)
Le 17-01-2023, à 08:07:02 -0500, Greg Wooledge a écrit :
If you went in via a Live CD, and mounted the Debian root partition,
the next step is to chroot into the Debian root partition. Then you
can run "passwd root" in the chroot shell. Then exit from the shell,
and unmount the Debian partition.
chroot can be tricky for newcommers…
Morning All,TBH, you can't, its a one way hash, add a "single" to the grub boot line
I have forgotten my password to a Debian PC using an SD stick as it's
main drive.
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
David.
.
Am 17.01.2023 um 07:14 schrieb Stanislav Vlasov:
вт, 17 янв. 2023 г. в 11:01, David <david.g_jones@ntlworld.com>:
Looking on the internet it says the passwords are stored in /etc/passwd
and /etc/shadow
In /etc/shadow only password's hashes, some data, one-way calculated
from password string.
The password string in /etc/shadow looks as if it's encoded, how can I
read this string?
You can't.Everyone (and their friend) seem to know, how to work around this, which apparently is common debian knowledge (which is nice).
But somehow, i feel there could be more caring about avoiding to teach
future hackers by accident. Is this kind of lesson appropriate for a
users list? - I doubt it.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 37:29:01 |
Calls: | 6,910 |
Files: | 12,376 |
Messages: | 5,428,817 |