Browser Based SSH

This might look like a duplicate of this ([offtopic] hosted ssh access & management) but it’s subtly different, I think.

Does anyone (cough @meredydd / @daviesian / @shaun cough ) have an idea on how to embed an SSH client within an Anvil app? I’m thinking https://mobaxterm.mobatek.net/ without all the frilly bits (just a centralised browser based way to access my servers.

You can embed anything within an Anvil app using an <iframe>, and we recently created a script to make the <iframe> automatically stretch to fit the contents of the app:

But you can also create an SSH client yourself in Anvil by using subprocess.check_output in a Server Module (OpenSSH is installed in the Anvil server runtime). Or of course you could do a similar thing with an Uplink script.

Here’s an app that does that:

https://anvil.works/ide#clone:SPDYFVUBP3ELTJGP=IJSIN73GSNLDPATTKKVLFIFC

2 Likes

Now this is very interesting … kind of annoyed I didn’t think of it myself. I do keep forgetting you can just send an ssh command without opening an interactive tty session.

I’m assuming you have to use a key rather than a password - how do you store it? In that variable?

This has given me a few ideas for my next project setup lab resources in DO setup ssh keys etc this could be fun :slight_smile:

Now this is what i was talking about :

https://shellngn.com/

But, it doesn’t half look risky. Thinking about it, they could be logging everything I type, so even if I use a minimal user/pass as entry point and su to root once in (so root details are not stored on the site) they could still see everything I;m doing.

It is very good, though. Shame I daren’t use it :slight_smile:

Here is another option for web based SSH:

https://bashify.io

Works great for me. No installation at all. Everything runs in the browser.

Welcome to Anvil!

Yeah, looks good, but it suffers from the same trust issues at the one I posted above, in that I have no idea what they are logging.

The shellngn one does at least allow you to install it locally, but again without a full audit of the code they could (intentionally or otherwise) have access to critical data in transit.

I guess any ssh management program suffers from that issue, even ones you install. I guess it’s just what one is comfortable with.

1 Like