Access shell via Power Options / Exit fails

Hello

I’m trying to access the shell on my Vero 4K+ by press ‘S’ for Power Options, selecting Exit option and pressing Esc when splash screen comes up.

I get the login screen, enter the user name and password and just get to the shell prompt for about 10s before main Kodi GUI reappears again.

I’ve tried this repeatedly and the same happens everytime.

Note: I CANNOT access via the shell via SSH. This because the SSHD service is failing to start and I need to be able to edit its config file to fix the problem, hence the need to access the shell locally.

I can view the SSH config file using the file manager, but there’s no edit option.

I tried to copy a repaired config file from a USB drive, but the osmc user does not have Write access rights, it requires root or using sudo.

I can’t delete or rename the file for the same reason.

Any ideas?

Thanks, Sean

This is my personal solution, not recommended. It’s a rescue tool since back in Kodi17, it gives you a root console, in the resolution Kodi leaves your TV in(in my case 1080p). Usually i just ssh into the device and grab an install script, but since that is not a possibility now, Here is how i would solve the issue:

First in my main PC/Mac:

Download a ftp client (filezilla), https://github.com/zjoasan/root_console/raw/master/install_root-vtconsole.zip
Unzip the zip in a new folder
Install Ftp-client

On the Vero4K(+):

Open MyOSMC->App store
Install FTP-server
Apply

Now connect to your Vero, over ftp from you PC, upload the two folders that got unzipped from my zip file,

They MUST be uploaded to the OSMC home folder.

When that is done, reboot your Vero, when it’s back on
Settings->Addon Browser->My Addons->Programs->Root-console->Enable

Now you should have unsafe(root access) to your device shell, exit command to return to Kodi.

Ps. remember this shell will have the same resolution as kodi had when you started the console. AND REMEBER this is root access, no sudo needed (with all what that means)

Which version of OSMC are you on?

I’m suspecting you may be on an old version of OSMC.

Sam

As an aside, you’ll notice that your device has a white and USB black USB port.

The white port supports USB OTG.

For situations where a user’s device is in a badly bootable state, we could expose the root filesystem over USB in a read-only manner so any critical files could be backed up.

I’ll see how feasible this is and also consider things from a security perspective. Usually if someone has physical access to a device anyway, it’s game over, but we could make this a configurable option in My OSMC.

Hi Sam,

Thanks for reply, according to Settings / System Info it’s 2023.01-1 (Kernel 4.9.269-21-osmc).

Sean

Hi Joakim_s

Thank you for your detailed response.

I did get the Root console installed and enabled it, but it fails to open (Add-ons / Program add-ons / Root console / Open / Program add-ons (again!?) / Root console).

It just returns to the menu after a slight pause.

Sean

hmm, try to change permission of the files in /home/osmc/root-console/ both .sh files need to have execute permissions. It probebly got lost in the “update” to version 19. I usually do this updates and ziping in linux enviroment, and then it retains filepermissions. But this became a “rush-job”, and i did it on a windows PC.

So test if you can change execute permission on the .sh files via ftp-client?

Get back to me if you can’t, then I’ll repackage the zip with the right file permissions on Linux, but that might be 24-48 hours away.

Thanks again.

I did manage to enable the execution attributes via FTP, and the Open got further, the progress wheel shows for about 30 seconds, then the screen goes blank and no responsive.

Could not get back to OSMC, akthough other background processes were still running, such as Transmission and the FTP.

Had to pull the plug.

Sean

Update: It seems the console was running but not being displayed.

so I created a script file to replaced the bad config file with the working one, copied it into the osmc home dir. via FTP, enabled execution flags and blindly tried to execute it in the console.

And it worked, so I now have SSH backup and running!

Thank you everyone for your help, Sean

1 Like

As long as you got ssh back up, seems I have to make an overhaul of the script.