My home network is currently sitting behind a DD-WRT router that I can access using public key authentication. Whenever I need to access something from my home network I can simply create an SSH tunnel from the DD-WRT router.
Providing my private key is kept safe and not compromised, I assume this is a pretty secure setup.
However, I would also like to be able to access the router even when I don't have an ssh client available and I only have a web browser available.
Can a secure solution be built (or are there existing services available) where I can use a web application (accessible via HTTPS) to access my router ?
I imagine the web application needs to be capable of creating an SSH connection to my DD-WRT router. For that, the web application needs to access my private key so it has to be sent to the web application.
I can imagine a couple of scenarios where
My private key is sent to the web application over https using a web form so that the web application can create the SSH connection. The web application receives the SSH key, doesn't persist the key to disk but keeps it in memory just to create the SSH connection.
A new keypair is generated specifically for the the web application. The web application stores the private key in its database and sends me the public key. The web application uses it to create the secure connection to my router. The web application would need to ensure that the private key is kept safe.
None of these scenarios make me feel very comfortable, but I don't know enough about security to make a proper assessment, and I would like to know if there are more appropriate solutions to this problem. (Having a web application act as an intermediary for doing this kind of SSH communication on behalf of the user ?)
Or is this something that is simply "not done".