0

I am new to linux and I wanted to start learning it. So, I had installed debian. But while installation, I forgot to give username and password for login and also for root.

Is it possible to log in to debian now without the username and password being set during installation?

If that is not possible, how do I re-install debian. Shall I just do it the same way I did the last time(by inserting the DVD?)?

If I re-install then during partitioning should I free both the main partition and the "Swap" partition or is it enough if I just delete the main partition.

Anthon
  • 79,293

2 Answers2

1

First of all how did you manage to install without setting a username and password? I don't think that is even possible.

Assuming you have somehow managed this feat, yes it is possible to log into a rescue session and create users/change password but it is really not worth the effort if you don't know what you're doing.

So, yes just put the DVD back in and reinstall. Make sure you format the root (/) and /boot (if you have one) partitions, you can leave the rest as they are.

terdon
  • 242,166
1

I have no idea how you managed to get through d-i without setting up either a root password or a user account with sudo. If you can figure out, please file a bug on that, it shouldn't be possible.

Its fairly easy to reset the root password.

  1. At the grub prompt, if it's not giving you the menu, hit escape to get it.
  2. Press e to edit the entry.
  3. Add init=/bin/bash to the end of the kernel line
  4. Press control-x to boot
  5. You'll get dumped to a shell prompt pretty soon. Run mount / -o remount,rw
  6. Run passwd. Enter your new root password twice.
  7. Run exec /sbin/init to boot the system

You now have a root password set, and you can use adduser to add a user account.

derobert
  • 109,670