Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. SSH client from inside app container

SSH client from inside app container

Scheduled Pinned Locked Moved Solved Support
dockercontainer
5 Posts 3 Posters 1.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • yusfY Offline
    yusfY Offline
    yusf
    wrote on last edited by girish
    #1

    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.

    1. I've managed to generate a keypair and use it with the -i flag, since /root/.ssh isn't writable. Did so with ssh-keygen -t rsa -b 4096, saving it to /app/data/ssh
    2. I've put the public key in the other server's authorized_keys.
    3. I've also used -o to use a custom known_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?

    1 Reply Last reply
    0
    • nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #2

      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 like 2044032d-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?

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by girish
        #3

        In the container, you can always do:

        ssh-keygen -f /run/bling.key # this generates /run/bling.pub and /run/bling.key
        
        scp -i /run/bling <args>
        
        1 Reply Last reply
        0
        • yusfY Offline
          yusfY Offline
          yusf
          wrote on last edited by yusf
          #4

          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 🙂

          1 Reply Last reply
          0
          • yusfY Offline
            yusfY Offline
            yusf
            wrote on last edited by yusf
            #5

            It proved a decent strategy given I get 50MB/s in a direct server-to-server transfer instead of caching it on my computer at a speed of 3MB/s.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search