@supernova
You can do that with regular android and termux, just don't know how far can you go with it
@nikolal You mean adb shell? I never really played with that much. Maybe its the same. But with a Debian based system I am familiar with it. And you can do ssh keys, is that possible with adb?
@supernova
No, I mean SSH. I use termux and SSH to connect to remote machines, but its possible to connect to Android phone from othet machine, see here for details.
https://wiki.termux.com/wiki/Remote_Access
@nikolal OK I see, yeah I'm not surprised that you can setup an ssh server with Termux. I never really felt the need to do that with Android, installing packages just by downloading the apk worked well enough and I never ran across any situation in my use cases where a CLI would be necessary. Using a mainline derived distro on a phone though the CLI is just so much easier since many things are accomplished this way.
@nikolal I wonder if you disable battery optimization in Termux if that would force it to remain active. Just be sure to exit when you are truly done so not to waste battery!