Force reset password?

A colleague has OSMC set up on a Raspberry Pi, and a few months ago they reset the ssh password for user osmc. Unfortunately they’ve now forgotten what that password was, so can it be reset either via the GUI or some other way please?

They are using ssh osmc@ip but both the default pass and what they thought it was set to doesn’t work anymore.

Thanks.

Edit cmdline.txt and set init=/bin/bash

Run passwd osmc

Remove init=/bin/bash

You can now login again.

Merry Christmas

Thanks!

I also had a mysterious password fail during an upgrade, I had only just changed the password before the update, so I blame bad typing, however with the current build I had to:

  • Edit /boot/cmdline.txt (e.g. by putting the flash card in another machine) and add the following to the end of the first line init=/bin/bash

e.g. mine looked like

root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2 init=/bin/bash

  • Boot your PI, it’ll go to a prompt, where you to type this to mount the storage read/write:

mount -rw -o remount /

  • Reset your password:

passwd osmc

  • Finally remove init=/bin/bash from /boot/cmdline.txt and reboot, and you’ll be back in OSMC.

  • (optionally) Crack open a beer when you realise you haven’t lost all your efforts.

Hope that helps someone.

You can also hold down shift or CTRL to get to the Recovery console, mount as RW, and run passwd. Saves editing cmdline

I’m having difficulty using PuTTY to SSH into my Pi. After entering my password it said “Access Denied”. So I followed the steps here and successfully changed my password and then tried to log in again and once again got “Access Denied”.
SSH server is running, I’m only failing after it asks me for a password.
Currently running the latest version Kodi 16.1.
Any ideas?

Have you tried the solution in the second post of this thread?

Indeed I have, and it didn’t work.

So I tried the fourth post in this thread and it did work, at least it reported that I had successfully changed my password.

But still getting access denied?

Yep, once I reset my password successfully, I put the memory card into my laptop, removed the additional line from the cmdline.txt and popped the memory card back into my Pi.

It fired up normally and I tried to connect via SSH both using PuTTY on my windows laptop and Terminal on my mac.

Both were able to see the Pi and get to the log in, but on putting in the password when requested they both reported access denied.

There are really only two reasons this can be. You are trying to connect to the wrong IP address or are entering the password incorrectly.

Can you connect a keyboard and login to the console by hitting escape after exiting Kodi?

This was the only two explanations I could arrive at also, but I checked and double checked the IP address. Plus if I had the wrong address I wouldn’t be able to get as far as I was getting with PuTTY whereby it was then requesting the password.

As for the password, I had only just entered (and re-entered) the new password and I kept it simple with lowercase “osmc”

I have a keyboard I can connect to the Pi. What do you suggest?

Become root.

Edit /etc/shadow. Set the OSMC line to this:

osmc:$1$P.ZH6EFu$L08/1ZYI6FdHu3aw0us.u0:17113:0:99999:7:::

I’ll try that when I get home, thanks.

What does it do exactly?

Sets the password hash to osmc for the OSMC user.

cat /etc/os-release | grep OSMC to make sure you’re actually doing it on the right system.

Cheers, I’ll give it a go and report back.

Hi Sam
Where do you run the cmd passwd ?

You run it on the Pi in the console.

How can I do that because I can’t not log in when I not have the right password so I can change it

1.Plug your card into another system -