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.
Improvements could be made to both addons, like setting a reading friendly resolution in root-shell and change the password restore to restore or ask for a new password to be reset.
Anyway since you seem to have some Linux experience, take a look at these rather simple scripts, and modify them the way that you feel fits your setup. PRâs are welcome =)
Iâm suggesting itâs something we should do. If you are still stuck, you could boot from SD or USB with an image we are testing. Let us know if you want access to those.
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.
Glad you cracked it. Iâve had a look at stopping the timeout as soon as a username is typed, but the bash is defeating me and itâs not a problem we get very often tbh.
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.
Anyway Iâm glad everything is resolved for @zerog
Sorry, I didnât mean your solution was not a âproper answerâ to solve the immediate problem. I meant we should be looking at modifying mediacenter permanently to make typing a long password possible.
And tbh I didnât realise how simple your solution could be. I donât spend a lot of time messing with addons.
Agreed, along with some other system management. But Iâm âtrying to put something togetherâ, that probably needs some âpolishing and refiningâ.
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â.