1

Device : Thinkpad X250 Distro : Ubuntu 20.04 ( the latest one)

So the problem is, i accidentally delete the username and password via /etc/passwd. I have 2 user, my main User Account is that i deleted. And the second user i forgot my pass. Any solution?

  • Reinstall the OS and don't forget the passwords? – ChanganAuto Oct 09 '22 at 10:01
  • Your question is rather unclear; latest Ubuntu - but you mention the 2020-April release (20.04) which was 5 releases ago? You've also tagged it's a boot problem (syslinux & grub) which relates how? You didn't say if desktop or server, as desktop system can be rather easily installed to fix lost-password (without destruction of data & Ubuntu repository software auto-reinstalled) but not if encryption is involved; your tags imply to me encryption is involved (thus booting is impaired?) – guiverc Oct 09 '22 at 10:48

1 Answers1

-2

You need a Linux USB Stick, for example you can buy one or you can flash an USB with Balena Etcher (on Linux) or Rufus (on Windows). To do this, you need another computer and an USB Stick. Then, you can boot linux from this USB. Now you can download a passwd and shadow for linux from the web, store it to /etc, boot linux again (withour the USB) and login with the new credentials. Then you can change your password.