Will_35
Posts: 5
Joined: Tue Oct 11, 2016 2:29 pm

I forgot my password...

Tue Apr 11, 2017 4:20 pm

I am pretty sure I know my username but I have forgotten my password I am running raspbian and I do not have a micro SD capable PC and do not want to get an adapter it has been months since I used my pi please help

User avatar
DougieLawson
Posts: 35344
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: I forgot my password...

Tue Apr 11, 2017 5:17 pm

USB adapters cost a quid.

Is this a NOOBS system or a plain Raspbian system?

If NOOBS hold or tap the [SHIFT] key during boot and you get the recovery system with a config.txt and command line (cmdline.txt) editor.

Change cmdline.txt from

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=84fa8189-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet
to

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=84fa8189-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/bin/sh
boot that and you'll get a root shell. Mount your rootfs and you can use the passwd pi command to reset your password.

If it's plain Raspbian you're going to need another computer (or another SDCard for your Raspberry) and a £1 USB reader. You can make the same edit on Windows using notepad+ or editpadlite7 or notepad++ or wordpad.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Will_35
Posts: 5
Joined: Tue Oct 11, 2016 2:29 pm

Re: I forgot my password...

Tue Apr 11, 2017 5:44 pm

DougieLawson wrote:USB adapters cost a quid.

Is this a NOOBS system or a plain Raspbian system?

If NOOBS hold or tap the [SHIFT] key during boot and you get the recovery system with a config.txt
and command line (cmdline.txt) editor.

Change cmdline.txt from

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=84fa8189-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet
to

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=84fa8189-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/bin/sh
boot that and you'll get a root shell. Mount your rootfs and you can use the passwd pi command to reset your password.

If it's plain Raspbian you're going to need another computer (or another SDCard for your Raspberry) and a £1 USB reader. You can make the same edit on Windows using notepad+ or editpadlite7 or notepad++ or wordpad.
Yes it is noobs and I have done that but it just goes to the normal password screen as though I have done nothing

User avatar
DougieLawson
Posts: 35344
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: I forgot my password...

Tue Apr 11, 2017 6:06 pm

Then you're not editing the right cmdline.txt.

Mounting the SDCard in another Linux system is going to be your best option. Or just reformat in your camera, get a copy of NOOBS 2.4 on it and start from a clean install.

Or use the NOOBS recovery system to trash everything and re-install.

Your choice. £6 (£5 for an 8GB SDCard & £1 for a USB reader) or trash and start from a blank newly installed system.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Will_35
Posts: 5
Joined: Tue Oct 11, 2016 2:29 pm

Re: I forgot my password...

Wed Apr 12, 2017 8:13 am

Sorry I'm a complete beginner on Linux and pi I have gotten into the command prompt but I don't know what you mean by mount your roots. Sorry but any help would be much appreciated

User avatar
DougieLawson
Posts: 35344
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: I forgot my password...

Wed Apr 12, 2017 8:43 pm

Scrap your SDCard and start with a fresh copy of NOOBS 2.4. You're venturing into territory where experts fear to tread. Recovery of a lost password isn't something I'd expect a new or novice user to be able to do.

If you go with a new SDCard and a USB reader you may be able to retrieve stuff you did before losing your password.

If you change your password write it down or store it in a secure password safe. Having a non-disclosed password is only important if you're running an internet server.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jmslee_2000
Posts: 1
Joined: Thu Apr 27, 2017 2:48 pm

Re: I forgot my password...

Thu Apr 27, 2017 3:10 pm

Hey, I wrote down my password after I installed Pure-FTPd but I cannot login my Pi via SSH, it always report me failed password, I tried to connect to FTP but password doesn't work. Does it help to edit cmdline.txt to reset password?

Will_35
Posts: 5
Joined: Tue Oct 11, 2016 2:29 pm

Re: I forgot my password...

Fri Apr 28, 2017 5:45 pm

I tried that I got to command prompt I'm probably really stupid I can change the password there right?

romermsp
Posts: 7
Joined: Fri Apr 22, 2016 3:39 pm

Re: I forgot my password...

Sun Aug 13, 2017 2:44 pm

hi all,
i try to reset my password because it was changed by a hacker.
when i input : mount -o remount,rw /,
it echo an error: can`t find partuuid=xxxxx,but i had already check that the partuuid is in the fstab,
so what's the problem?

beta-tester
Posts: 1235
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: I forgot my password...

Sun Aug 13, 2017 8:35 pm

what uuid does the partition has - you can get with blkid?
and what uuid is in the /etc/fstab (and what uuid is in the cmdline.txt)?
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B, RPi3B, RPi3B+, RPiZeroW, ...

romermsp
Posts: 7
Joined: Fri Apr 22, 2016 3:39 pm

Re: I forgot my password...

Mon Aug 14, 2017 4:33 am

beta-tester wrote:
Sun Aug 13, 2017 8:35 pm
what uuid does the partition has - you can get with blkid?
and what uuid is in the /etc/fstab (and what uuid is in the cmdline.txt)?
hi beta-tester,

blkid:
/dev/mmcblk0p1: label ="boot" uuid="50a6-027f" type="vfat"
/dev/mmcblk0p2: uuid="5c01c1ce-fe60-428a-8e68-0be0e8ed6b7a" type="ext4"

/etc/fstab:
partuuid=96c161cb-01 /boot .......
partuuid=96c161cb-02 / .......

cmdline.txt:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1
root=PARTUUID=96c161cb-02 rootfstype=ext4
elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
init=/bin/sh


Thanks

beta-tester
Posts: 1235
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: I forgot my password...

Mon Aug 14, 2017 10:11 am

oops, i thought, blkid will show the PARTUUID as well. on my pi, it shows me the PARTUUID.
why do you have to remount the root / as read-write, isn't it mounted as rw already?


i think it is quicker (and safer) to reflash & reinstall the SD card... specially when you say, you were hacked - who know, what else was hacked.
Last edited by beta-tester on Mon Aug 14, 2017 10:15 am, edited 1 time in total.
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B, RPi3B, RPi3B+, RPiZeroW, ...

User avatar
RaTTuS
Posts: 10313
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: I forgot my password...

Mon Aug 14, 2017 10:14 am

romermsp wrote:
Sun Aug 13, 2017 2:44 pm
hi all,
i try to reset my password because it was changed by a hacker.
when i input : mount -o remount,rw /,
it echo an error: can`t find partuuid=xxxxx,but i had already check that the partuuid is in the fstab,
so what's the problem?
start again from a fresh install , a hacked system leaves you exposed to too much stuff,
with the new install do not expose the user pi to the internet without changing it's password at the very least
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

romermsp
Posts: 7
Joined: Fri Apr 22, 2016 3:39 pm

Re: I forgot my password...

Tue Aug 15, 2017 12:40 pm

beta-tester wrote:
Mon Aug 14, 2017 10:11 am
oops, i thought, blkid will show the PARTUUID as well. on my pi, it shows me the PARTUUID.
why do you have to remount the root / as read-write, isn't it mounted as rw already?

i think it is quicker (and safer) to reflash & reinstall the SD card... specially when you say, you were hacked - who know, what else was hacked.
set init=/bin/sh in cmdline.txt to boot ,the file system is read only.
the reason I try to reset the password is that I want read the log more convenient by ssh,to know when and how did he hacker attack me.
ok,I decide to reinstall now. thanks

romermsp
Posts: 7
Joined: Fri Apr 22, 2016 3:39 pm

Re: I forgot my password...

Tue Aug 15, 2017 12:46 pm

RaTTuS wrote:
Mon Aug 14, 2017 10:14 am
romermsp wrote:
Sun Aug 13, 2017 2:44 pm
hi all,
i try to reset my password because it was changed by a hacker.
when i input : mount -o remount,rw /,
it echo an error: can`t find partuuid=xxxxx,but i had already check that the partuuid is in the fstab,
so what's the problem?
start again from a fresh install , a hacked system leaves you exposed to too much stuff,
with the new install do not expose the user pi to the internet without changing it's password at the very least
yes ,I kept the default password and map the port 80 to the route...
you are right ,thanks

Return to “Troubleshooting”