You have Linux on your Desktop PC?
Before you stared using your Rasperry Pi you wrote a image (like raspbian) on your sdcard. In this image there is also the /etc/passwd
file.
So first of all you have to extract the original passwd file from the image you have downloaded:
sudo kpartx -av raspbian.raw # setup loopback and mapper block devices sudo mount /dev/mapper/loop0p1 /mnt # mount partition to /mnt sudo cp /mnt/etc/passwd ~/passwd # copy passwd to home
Then mount your sdcard with terminal or with your graphical user interface. After that you can copy the original passwd
file to the sdcard:
sudo cp ~/passwd /media/username/mmc/etc/passwd # copy passwd to sdcard sync # flush buffers
Now you can insert the sdcard back into the raspberry pi and try again.
Please note that kpartx
is a special tool, which is not default installed on Ubuntu, you have to install it with
apt-get install kpartx