←back to thread

816 points tosh | 1 comments | | HN request time: 0s | source
Show context
lotharrr ◴[] No.41276886[source]
author here.. happy to answer any questions!
replies(9): >>41276960 #>>41277084 #>>41277310 #>>41277500 #>>41277604 #>>41277995 #>>41278638 #>>41278665 #>>41284597 #
matricaria ◴[] No.41277310[source]
Why is this better than rsycn or scp?
replies(1): >>41277551 #
lotharrr ◴[] No.41277551[source]
scp/rsync are great tools, but they require pre-coordination of keys. One side is the client, the other is the server. The client needs an account on the server machine (so the human on the client machine must provide an ssh pubkey to the human on the server machine, who must be root, and create a new account with `adduser`, and populate the ~/.ssh/authorized_keys file). And the client needs to know the server's correct hostkey to avoid server-impersonation attacks (so the human on the server machine must provide an ssh host pubkey to the human on the client machine, who puts it in their ~/.ssh/known_hosts file).

Once that's established, and assuming that the two machines can reach each other (the server isn't behind a NAT box), then the client can `scp` and `rsync` all they want.

Magic-wormhole doesn't require that coordination phase. The human sending the file runs `wormhole send FILENAME` and the tool prints a code. The human receiving the file runs `wormhole rx CODE`. The two programs handle the rest. You don't need a new account on the receiving machine. The CODE is much much shorter than the two pubkeys that an SSH client/server pair require, short enough that you can yell it across the room, just a number and two words, like "4-purple-sausages". And you only need to send the code in one direction, not both.

Currently, the wormhole programs don't remember anything about the connection they just established: it's one-shot, ephemeral. So if you want to send a second file later, you have to repeat the tell-your-friend-a-code dance (with a new code). We have plans to leverage the first connection into making subsequent ones easier to establish, but no code yet.

Incidentally, `wormhole ssh` is a subcommand to set up the ~/.ssh/authorized_keys file from a wormhole code, which might help get the best of both worlds, at least for repeated transfers.

replies(1): >>41278051 #
InfiniteRand ◴[] No.41278051{3}[source]
But if you already have ssh set up for the target machine, is there any advantage such as speed or recoverability vs scp?
replies(2): >>41278689 #>>41286591 #
1. mistell ◴[] No.41286591{4}[source]
The whole point is wormhole fills in a gap where scp isn’t viable or convenient.