@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
@supernova
Ony bad thing with Termux is that it doesn't have consistent connectivity, meaning that your phone has to be awake and screen focused on app for it to maintain ssh connection. If you have needs for better connectivity than termux you can use this, people say its prommising.
https://mosh.org/
@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!