home / tils / til

Menu
  • GraphQL API

til: fly_scp.md

This data as json

path topic title url body html shot created created_utc updated updated_utc shot_hash slug
fly_scp.md fly How to scp files to and from Fly https://github.com/simonw/til/blob/main/fly/scp.md I have a Fly instance with a 20GB volume, and I wanted to copy files to and from the instance from my computer using `scp`. Here's the process that worked for me. 1. Connect to Fly's WireGuard network. Fly have [step by step instructions](https://fly.io/docs/reference/private-networking/#step-by-step) for this - you need to install a WireGuard app (I used the [official WireGuard macOS app](https://www.wireguard.com/install/)) and use the `fly wireguard create` command to configure it. 2. Generate 24 hour limited SSH credentials for your Fly organization: Run `fly ssh issue`, follow the prompt to select your organization and then tell it where to put the credentials. I saved them to `/tmp/fly` since they will only work for 24 hours. 3. Find the IPv6 private address for the instance you want to connect to. My instance is in the `laion-aesthetic` application so I did this by running: `fly ips private -a laion-aesthetic` 4. If the image you used to build the instance doesn't have `scp` installed you'll need to install it. On Ubuntu or Debian machines you can do that by attaching using `fly ssh console -a name-of-app` and then running `apt-get update && install openssh-client -y`. Any time you restart the container you'll have to run this step again, so if you're going to do it often you should instead update the image you are using to include this package. 6. Run the `scp` like this: `scp -i /tmp/fly root@\[fdaa:0:4ef:a7b:ad0:1:9c23:2\]:/data/data.db /tmp` - note how the IPv6 address is enclosed in `\[...\]`. <p>I have a Fly instance with a 20GB volume, and I wanted to copy files to and from the instance from my computer using <code>scp</code>.</p> <p>Here's the process that worked for me.</p> <ol> <li>Connect to Fly's WireGuard network. Fly have <a href="https://fly.io/docs/reference/private-networking/#step-by-step" rel="nofollow">step by step instructions</a> for this - you need to install a WireGuard app (I used the <a href="https://www.wireguard.com/install/" rel="nofollow">official WireGuard macOS app</a>) and use the <code>fly wireguard create</code> command to configure it.</li> <li>Generate 24 hour limited SSH credentials for your Fly organization: Run <code>fly ssh issue</code>, follow the prompt to select your organization and then tell it where to put the credentials. I saved them to <code>/tmp/fly</code> since they will only work for 24 hours.</li> <li>Find the IPv6 private address for the instance you want to connect to. My instance is in the <code>laion-aesthetic</code> application so I did this by running: <code>fly ips private -a laion-aesthetic</code> </li> <li>If the image you used to build the instance doesn't have <code>scp</code> installed you'll need to install it. On Ubuntu or Debian machines you can do that by attaching using <code>fly ssh console -a name-of-app</code> and then running <code>apt-get update &amp;&amp; install openssh-client -y</code>. Any time you restart the container you'll have to run this step again, so if you're going to do it often you should instead update the image you are using to include this package.</li> <li>Run the <code>scp</code> like this: <code>scp -i /tmp/fly root@\[fdaa:0:4ef:a7b:ad0:1:9c23:2\]:/data/data.db /tmp</code> - note how the IPv6 address is enclosed in <code>\[...\]</code>.</li> </ol> <Binary: 93,002 bytes> 2022-09-02T15:39:04-07:00 2022-09-02T22:39:04+00:00 2022-09-02T15:39:04-07:00 2022-09-02T22:39:04+00:00 6f6d33491b25a9e67f82d62fc61ed9c9 scp
Powered by Datasette · How this site works · Code of conduct