How can I directly edit text files over SSH or FTP? Sometimes I want to edit text files on a remote computer (such as linux scripts, websites, etc.) but I only have an Android device at hands (let's say I'm sitting in a train and have nothing better to do with my time).

I could download the files over SSH, edit them, and upload them again, or even edit them on the SSH console, but this is tedious (I mean MORE tedious than it already is to edit text with an handheld device, if that is possible).

Is there a way that I can directly edit the files remotely? I would envision a solution that might, for example, automatically download the file, and upload it back on save.
For what it's worth, here are the solutions I've found so far, but I'm happy with none:

DroidEdit has an SFTP/FTP option in the pro (paid) version. I have not tested it myself so I can't guarantee anything.

I used to mount a samba or NFS share on my local Android file system, using the CifsManager app, which can be tunneled through SSH, and then you work on the files as if they were on your local device. However, this required a rooted device, and I'm not sure it's still possible with recent Android systems (the problematic part being to mount a file system that isn't provided by the base Android system ; it seems the cifs or nfs kernel module is not part of standard ROMs anymore).

If your remote computer has a desktop environment, you could use a VNC client (there are a few available for Android). But remote applications are not designed to work with a touchscreen, and without keyboard/mouse.