I need to access my Vero locally through its terminal. So far so good, in order to do that I exited Kodi and pressed ESC (also tried ALT+F3), the command line appears. Unfortunately, being security aware, my password is rather long and requires some time for typing. So during typing Kodi starts up again and the console disappears (which is expected with restart=always in the service file, I guess). Is it possible to
Make the command line permanent, not allowing Kodi to overlap it or
change the osmc user password within Kodi?
The background: I was playing around with installing a firewall (I know, it’s not supported…) and somehow I managed to lock myself out after a routine Vero reboot (must have something to do with making ip-tables permanent). So SSH or any other access via network is not possible.
I haven’t found the time to change the password using @joakim_s script, so yeah, still stuck. I’d like to try that. So you mean booting from SD/USB and modifying the mediacenter service file of the main installation?
I’ve sent you an invite to a testing thread. You can boot from that image, mount /dev/vero-nand/root and maybe sort out your firewall from there. Or as Sam says, edit out the restart from the mediacenter service file.
Edit: I just checked - we give you 30 seconds to type your username and password. If that’s not enough, change it in line 206 of /usr/bin/mediacenter.
I was able to boot from the image and increased the time following your suggestion. This helped me logging in (cursing myself for the long password), correcting iptables and gaining access again. I wonder if it’s easy/feasable/worth considering to add an option to Kodi/My OSMC for disabling mediacenter restart.
While the the USB image is named the same, it’s still another os. Configured differently, perhaps newer bins etc. So in my mind, writing an image to USB, boot on it in order to mount your “normal file system” in another OS and do the repair…
I might be crazy but I do think, booting a whole other OS to correct a “broken password” or to gain root access. Seems like overkill when you got a running Kodi in OSMC, and can download a few “allthough not SAFE for average Joe”-addons. Say you download to another computer. Chose to write to a usb-stick or put it on an accessible network share, and use Kodi filemanager to add a source and install the downloaded zip.
True I could put some work into those addons to be better/safer. But they have been my “emergency” rescue kit from time to time.
Yes, I agree, your addons are a solution way easier than booting from a “different” OS. I have reviewed your code and I do find it very useful. If I find some time I may contribute. I do have a pythonic background but wasn’t aware of addons being written in Python. Anyway, I changed the solution to your answer.
I do think so. When I was meddling with iptables, I haven’t thought about local access being a problem. I have no intend of starting a discussion on having no firewall configured, but following a “never trust anything/deny all, but…” policy such situation are quite common to me…
As you see in the addons, they are just a python wrappers for running some bash commands. I would love to do it more pythonic, but my python experience (or lack there of) is not worth mentioning. I usually read other peoples solutions and like a script-kiddie “copy & paste” multiple parts together to “make something” that works for me.
Any input is appreciated, be it PR’s, comments here on the forum or even a PM or two here. I really like other peoples input, since I often stare blindly on my “creations”.