-1

I tried

apt-get install passwd --reinstall

But it says

Reinstallation of passwd is not possible, it cannot be downloaded.

Help please. I have no backup of this.

Debian version:

root@localhost# lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.11 (wheezy)
Release:        7.11
Codename:       wheezy
  • Install a new system with all the packages on your system. Add the users that you added manually. Copy passwd. – KamilCuk Sep 11 '21 at 08:18

1 Answers1

1

Fist create a live system.

Then start your live system and mount your filesystem.

After that copy the /usr/bin/passwd from the live system to your filesystem.

After that is should be available again.

(You can not restore the data of the files with that. You could try a recovery software for that, if you didn´t do to mutch already so the data may is still not overridden.)

DJPX
  • 56
  • 1
  • 8
  • In other words, boot from a live (or rescue) CD or flash drive that you installed your system with (or download and create one on another machine). Most will provide the ability to `chroot` your current Linux install under a directory you choose. See [chroot](https://wiki.archlinux.org/title/Chroot) (follow the `chroot` directions at mid-page, not `arch-root` up top). Once you have chrooted your `/` directory, you can copy the password file back. E.g. if chrooted under `/mnt` then `cp -a /liveCD/bin/passwd /mnt/usr/bin` (check ownershipt is still `root:root`) – David C. Rankin Sep 11 '21 at 09:18