Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question
add comment

marked as duplicate by jasonwryan, derobert, Anthon, Stephane Chazelas, Hauke Laging Jun 6 '13 at 19:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.