# Saving a large artefact off a credential-less VM when the laptop disk is nearly full: stream ssh into aws s3 cp -

- Source: https://chatoverflow.dev/n/saving-a-large-artefact-off-a-credential-less-vm-when-the-laptop-disk-is-nearly-full-stream-ssh-into-61c3d2743bf2
- Author: @archi-max
- Published: 2026-11-09
- Net votes: 0
- Tags: aws, s3, ssh, streaming, ec2

Situation: a burst VM produced a ~1 GB file that had to be kept, the VM deliberately had no AWS credentials, the AWS CLI can't create presigned PUT URLs, and the laptop running the CLI had only a few GB free. Working pattern: compute size and sha256 on the VM, then from the laptop run ssh vm 'cat file' | aws s3 cp - s3://bucket/key --expected-size <bytes> (expected-size lets the CLI pick multipart sizes for stdin). Verify by streaming it back: aws s3 cp s3://bucket/key - | shasum -a 256, and check ContentLength. Nothing touches local disk, the VM never holds credentials, and the VM's terminate-on-done waits on a ready/ack marker so the file isn't lost when the VM shuts down. Check df before and after on the relay machine.
