Forgot password for user osmc

Folks,

Trying to ssh into my vero 4k+, however forgot the password that I had changed using passwd. Any way to reset the password other than a new install?

Thanks!

Connect a keyboard to the Vero and reboot the device and press+hold the Ctrl.

That should bring you to login. You should be able to login with root.
Then can try to change password with passwd osmc

2 Likes

Unfortunately this did not work … it comes back to the prompt with “osmc login:”. I put in root but putting in a blank password does not work. Unfortunateky I do not remember what I changed the default password to :frowning:

It’s looking like a reinstall. But backup and restore should still work.

Yup … looks like a reinstall … will the backup and restore save the drive mappings to my NAS drives? It was pain to map them using the GUI.

The sources.xml (what you configure via GUI) will be part of the backup.
You always can review the files in the backup to ensure you have what you need.

Just need slight help with the backup & restore … I will use the My OSMC menu and do a complete backup onto my microSD card which is in the Vero 4k+. Then I will use the re-install image on another microSD card and copy the backup data to this new card that has the re-install boot image … will Vero 4k+ automatically restore my backed up data after the new image has been installed?

The same way you backed up is the same way you restore. I think the version of My OSMC that is in stable is missing the passwords.xml file so if you are using a network file share that requires a password you may want to install and use the “Backup” add-on from Kodi’s repository. It works pretty much the same way in that you select what you want and you tell it to backup. On a fresh install you install the add-on again, select everything you want to restore, and then tell it to restore.

Ok I have found a solution for your password problem. If you still have access via samba (or in case you haven’t installed samba before install it from App Store.

  1. Create a file (chpass.py) and copy to /home/osmc/ with this content
#!/usr/bin/python
import os
os.system("/bin/echo -e 'osmc\nosmc' | /usr/bin/sudo /usr/bin/passwd osmc")
  1. Create a file xchpass.xml and copy to /home/osmc/.kodi/userdata/keymaps/ with this content
<keymap>
<global>
<keyboard>
<rightbracket>XBMC.RunScript(/home/osmc/chpass.py)</rightbracket>
</keyboard>
</global>
</keymap>

Restart the Mediacenter and then press the menu button on your OSMC remote control. If your using a different remote you will need change the “rightbracket” entries in the keymap to match something appropriate for your input device.

Now your password should be osmc. After you got access successful change your password and then delete the two files you created.

1 Like

Since I “loved” @fzinken solution, but thought, lets make it an option to have after a change. Like I do forget passwords on a regular basis. I did a small Kodi 18.x(apparently works on v.19, right now) addon, which you can install into Kodi, and when ever you need it it should be under “Programs” in main menu.

download this zip file:
Passwd_Restore

Transfer it to your OSMC device, open Settings->Addon browser->Install from zip

Chose homefolder and navigate to “main.zip” or if you renamed it, to the filename you chose.

What this addon does is restore osmc user to the default password: osmc

5 Likes

This is fantastic @joakim_s … going to try this out and let you know how it works out. Thanks!!!

Edit: @joakim_s … just wanted to let you know this worked perfect.
Steps:

  1. Downloaded the osmc_passwd_restore-main.zip file to my NAS drive folder
  2. Transferred it to Vero4k+ using Settings->Addon Browser-> Install from zip and selecting the downloaded file
  3. Click on Addons → selected the osmc_passwd_restore addon and enabled it
  4. Rebooted Vero and held the Ctrl key on my Vero 4k+ connected keyboard until the login prompt appeared on the screen
  5. Was able to log on with username: osmc and password:osmc
  6. Vero suggested to changed the password from default osmc … so changed it and wrote it down and took a picture of the written down password so that I will never forget it again.

Thanks a million for creating this valuable addon … don’t have to re-install OSMC and do everything from scratch again!!!

2 Likes

Thank you @fzinken … once I create the 2 files … any way to copy them using the GUI as I do not have access to the shell :slight_smile:

AIUI, that’s what installing Samba is for.

Using Samba/SMB from your desktop machine as indicated in my post. If you haven’t used samba before then just install it from the App Store.
Alternatively if you have a NAS source configured on your Vero you could use the Kodi Filemanager to copy files from your NAS. In that regards it might be easier to use the solution from @joakim_s as only single file needed.

Update: I didn’t know that a Vero uses eMMC for boot storage. Nice. That means my suggestion to pull the microSD won’t work on a Vero. Also, it should be stated that the statements below are lacking details - more of an outline to options.

I see this is solved, but I’m surprised that nobody said to pull the microSD card, connect it to almost any other Linux computer, setup a chroot for the /etc/ directory and run the sudo passwd osmc command. Caveat - this would work best with an ARM-based distro.

Or to reboot into single-user-mode/maintenance mode, when prompted for cntl-d use that to login as root, then sudo passwd osmc - Bob’s your uncle.

These are very normal Linux methods, but I will admit that I don’t know if they work on ARM or not. As long as the OS isn’t encrypted, physical access to the storage for any computer means total pwnage. Usually. Even on systems with hardware lockouts, a dedicated person can almost always find a way to gain root.

Because this user has a Vero where the OS is on the built-in emmc.

There is such option but we decided for alternatives.

Ah - my ignorance is on display for all. Thanks for being nice about it.

I got a python 3.0.0 dependency not met…
but eventually used another way , withou the extension, just running from gui

I didn’t have the smb, but there is the File explorer in Kodi GUI
I navigate to my nfs share, and clicked on the .py , that gave an error
now from the GUI I copied the file to /home/osmc, clicked on it… nothing…

well nothing showed, but it worked :slight_smile:
tx again !

Yeah sorry about python requirements, update all my Homebrew add-ons to kodi19

2 Likes