SSH client from inside app container
-
I need to transfer data from a linux server to the data directory of a Cloudron app. Figured I'd do so server-to-server with
scp
.- I've managed to generate a keypair and use it with the
-i
flag, since/root/.ssh
isn't writable. Did so withssh-keygen -t rsa -b 4096
, saving it to/app/data/ssh
- I've put the public key in the other server's
authorized_keys
. - I've also used
-o
to use a customknown_hosts
file.
Still, I get this:
Could not create directory '/root/.ssh'. Load key "/app/data/ssh/id_rsa.pub": invalid format user@IP: Permission denied (publickey).
How can I get it working?
- I've managed to generate a keypair and use it with the
-
The ssh server is running on the linux host not inside the app as such. So in your case you would have to scp to the server itself and the destination for the files would be something like
/home/yellowtent/appsdata/<appid>/data/
where appid can be obtained for example via the dashboard in the app configure view (it is the id shown in the url bar of the browser and looks like2044032d-2f56-4c84-926f-7a1ec272f7f1
)
Generally this flow is not great usability wise and you have to be careful what to overwrite with this inside the app data. Also to ensure filesystem permissions are correct, you have to restart the app afterwards.Can you maybe explain the actual use-case for this and maybe there is an alternative process to get data inside the app?
-
Ah yes, it didn’t even occur to me that I could just scp from box the whole time. Somehow I’ve compartmentalized the app data to be not reachable from the host system when in fact it easily is. ️
I’m migrating a WP site. I know that there are other ways too