4 ms·
Not only Zmodem was cool, it was also open source back then, and very easy to integrate into your program. In fact, little known fact, it's still very useful t
by buserror 11y ago
Not only Zmodem was cool, it was also open source back then, and very easy to integrate into your program.
In fact, little known fact, it's still very useful today; if you ssh into a box that has it installed, and you have it installed locally, you can quickly send yourself back a file with it, across the current connection...
Just to 'sz <file>' on the remote side, and do <return><tilde>|rz<return>
to tell you ssh client to start 'rz' locally and zoom, zmodem the file over.
Works the other way too...
- k8tte 11y agoor just use scp, which is part of openssh
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- buserror 11y agoTry that thru a double connection? ie, ssh-ing to a machine from an already open ssh session? I'm amazed I get -1 for that post; scp is clunky as hell when you already have a shell in 'that' directory; and it'll only work if you have /direct/ access to the machine you are logged in, and that's rarely the case if you first connect to a front end machine. I'm an embedded dev as well, and I use zmodem everyday. I have boards that have no network, just a serial port, and I can upload an executable, download the log from just the debug console.
- jacquesm 11y agoIt's interesting how tcp/ip is pretty much taken for granted. Of course you could run SLIP over that serial port ;) Just the other day I was bitching about how it is easier to drive a printer than a relay from a present day computer, the answer I got back was 'can't you use an arduino?'...
- buserror 11y agoHehe you'd be /amazed/ how much smaller the kernel gets it you don't put in IPv4/6 -- and let me tell you, when you upload via uart, every little helps :-) My fav method is to build a kernel with just busybox using my minifs [0], making sure I have kexec support in that kernel. Once booted, I can upload a new kernel via zmodem, and kexec straight into the new kernel. Rince, repeat! You can also use zmodem to upload new binaries to a system, even if it's an initramfs, without having to do a full rebuild/reboot. Quite handy. [0]: https://github.com/buserror/minifs https://github.com/buserror/minifs
- voltagex_ 11y agoI wonder if I could use zmodem via VirtualBox's serial port... I mean, I have PXE for loading new kernels but this seems cooler.
- throwaway7767 11y ago> I'm amazed I get -1 for that post; scp is clunky as hell when you already have a shell in 'that' directory; and it'll only work if you have /direct/ access to the machine you are logged in, and that's rarely the case if you first connect to a front end machine. I did not downvote you, but setting up a port forward (-L) or SOCKS proxy (-D) on the first machine is very easy and extremely flexible. I do it all the time. You can also do some tricks in ssh_config to route through the first machine (this is non-obvious, I'll grant). I do "ssh <secondmachine.whatever.tld>.<hopmachine>", and then I transparently connect from my workstation to the secondmachine, through the hopmachine. This is also more secure as the hop machine is just a dumb transport for data. > I'm an embedded dev as well, and I use zmodem everyday. I have boards that have no network, just a serial port, and I can upload an executable, download the log from just the debug console. Absolutely, zmodem is still very useful for serial links, and they are very common in embedded devices. I really doubt there's any reason to use zmodem over SSH other than convenience if you happen to know it better than the alternatives.
- rlonstein 11y ago> I really doubt there's any reason to use zmodem over SSH other than convenience if you happen to know it better than the alternatives. You might not have encountered it. Here's the use case: the ssh session terminates at a bastion host running a restricted sshd that drops port forwards and punts the connection to an internal landing host which is not permitted to ssh out. Using an in-band file transfer protocol is incredibly useful.
- laumars 11y agoIf you have SSH keys set up then: cat file.bin | ssh -A host1 ssh host2 "cat > file.bin" Then there's other tricks you could do like port forwarding, filesystem mounting over SSH (sshfs) etc. But if zmodem works for you then it's as good a solution as any of the above. I only give SSH examples as demonstration at just how scarily powerful a tool it can be.
- jacquesm 11y agoThat assumes ssh is present to begin with. Really in the embedded world (which was the context if I got it right) you can just about throw all those assumptions out of the window. You're roughly back in 1989 or so when it comes to the features available to you in the environment, unless you're going for the more powerful platforms (with associated physical footprint, power consumption and boot times).
- laumars 11y agoThe context if this discussion was tunnelling zmodem over SSH, so I think it's a fair assumption that SSH is installed :) But you're right regarding embedded *nix in broader contexts.
- jacquesm 11y agozmodem is 'in band', scp is out-of-band, you may not even have direct access to the machine you wish to transfer from.
- cnvogel 11y agoIt's also useful today when you have an embedded system without a (or a not yet) working network connection. [https://ohse.de/uwe/software/lrzsz.html https://ohse.de/uwe/software/lrzsz.html]. I've also used in the past with ancient lab equipment built around XT/AT PCs.
- skyjumper 11y agoWhich ssh client supports the <return><tilde>|rz<return> key combo? I'm not seeing it in openssh.
- liveoneggs 11y agogreat tip
- konradb 11y agoOh you've just given me a huge dose of nostalgia - I used to do that over telnet back in... 92 or 93 I forget which. I had completely forgotten that sz/rz existed.
- rlonstein 11y ago> n fact, little known fact, it's still very useful today; if you ssh into a box that has it installed, and you have it installed locally, you can quickly send yourself back a file with it, across the current connection... This has been my use case for having lrzsz everywhere since dog knows how long. Nicely, iTerm2 has pattern-based triggering which lets you fire off zmodem. I keep meaning to sit down and hack on tmux so that transfers will pass through cleanly. RIP Chuck, you've saved me countless hours.