News for hackers. Stuff that matters.
Re:Chuck Forsberg has died – author of Zmodem by buserror on Thursday November 19, 2015 @05:26AM (#10593939)
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...

Re:Chuck Forsberg has died – author of Zmodem by cnvogel on Thursday November 19, 2015 @08:16AM (#10594536)
It'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].

I've also used in the past with ancient lab equipment built around XT/AT PCs.

Re:Chuck Forsberg has died – author of Zmodem by rlonstein on Thursday November 19, 2015 @03:05PM (#10597181)
> 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.

Re:Chuck Forsberg has died – author of Zmodem by konradb on Thursday November 19, 2015 @10:13AM (#10595167)
Oh 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.
Re:Chuck Forsberg has died – author of Zmodem by skyjumper on Thursday November 19, 2015 @08:46AM (#10594693)
Which ssh client supports the <return><tilde>|rz<return> key combo? I'm not seeing it in openssh.
Re:Chuck Forsberg has died – author of Zmodem by gusfoo on Thursday November 19, 2015 @09:54AM (#10595071)
OpenSSH supports "~" as an escape character when it's the first character on a line. So try "<return>~?" to see a list of available commands.
Re:Chuck Forsberg has died – author of Zmodem by skyjumper on Thursday November 19, 2015 @10:06AM (#10595133)
Is there a way to pipe output to another program the way buserror described?
Re:Chuck Forsberg has died – author of Zmodem by liveoneggs on Thursday November 19, 2015 @10:07AM (#10595136)
great tip
Re:Chuck Forsberg has died – author of Zmodem by k8tte on Thursday November 19, 2015 @05:36AM (#10593972)
or just use scp, which is part of openssh
Re:Chuck Forsberg has died – author of Zmodem by buserror on Thursday November 19, 2015 @05:53AM (#10594032)
Try 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.

Re:Chuck Forsberg has died – author of Zmodem by jacquesm on Thursday November 19, 2015 @06:30AM (#10594163)
It'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?'...

Re:Chuck Forsberg has died – author of Zmodem by buserror on Thursday November 19, 2015 @06:39AM (#10594199)
Hehe 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

Re:Chuck Forsberg has died – author of Zmodem by voltagex_ on Thursday November 19, 2015 @08:14AM (#10594524)
I wonder if I could use zmodem via VirtualBox's serial port... I mean, I have PXE for loading new kernels but this seems cooler.
Re:Chuck Forsberg has died – author of Zmodem by throwaway7767 on Thursday November 19, 2015 @06:35AM (#10594181)
> 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.

Re:Chuck Forsberg has died – author of Zmodem by rlonstein on Friday November 20, 2015 @12:53PM (#10602626)
> 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.

Re:Chuck Forsberg has died – author of Zmodem by laumars on Thursday November 19, 2015 @07:18AM (#10594320)
If 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.
Re:Chuck Forsberg has died – author of Zmodem by jacquesm on Thursday November 19, 2015 @08:02AM (#10594482)
That 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).
Re:Chuck Forsberg has died – author of Zmodem by laumars on Thursday November 19, 2015 @09:37AM (#10594974)
The 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.

Re:Chuck Forsberg has died – author of Zmodem by jacquesm on Thursday November 19, 2015 @05:57AM (#10594049)
zmodem is 'in band', scp is out-of-band, you may not even have direct access to the machine you wish to transfer from.