sqt -- SSH Quick Tunnel
Posted by BlackFuffey@reddit | linux | View on Reddit | 17 comments
I made sqt, a convenient unix-style tunnel tool for local or remote use over ssh.
sqt is useful when you are working across terminals or SSH sessions and you just want to stream data from one place to another without setting up a full file transfer or complicated SSH command
This is especially convenient with remote work. Often you already have a shell open on a remote machine, and you want to send data from/to your laptop. Normally you might reach for scp, rsync, or a long SSH pipeline. Those are great tools, but they can be very verbose and annoying to setup when you only need a quick one-off transfer. sqt was created to solve exactly that.
fellipec@reddit
I watched your demo.mp4
But I don't get the use case. I mean... just
ssh server cat file?BlackFuffey@reddit (OP)
The point is it’s forwarding stdio. So you can chain it together with other stuff, or serve file over relative paths and such
Craftkorb@reddit
You can also pipe through
ssh..?Your demo could be a simple scp.
BlackFuffey@reddit (OP)
Which spawns a new non interactive and not setup shell that may be annoying to work with
Craftkorb@reddit
If I pipe stuff into it, where should the input come from if not from stdin? It's the same behaviour like any other Unix pipe
BlackFuffey@reddit (OP)
you dont have envs and current working directory. you also cant do things like
{ cat foo; sqt -o } | ...Dangerous-Report8517@reddit
It sounds an awful lot like you're asking people to trust this random binary with access to their SSH keys in an environment with regular frequent high profile LPEs being published without patches to accomplish something that can be done with a couple of BASH aliases and maybe setting up your ssh_config a bit. SSH can already send environment variables over, it just needs you to put it in a file (explicit action is also arguably better here since you don't necessarily want to send across all loaded environment variables which often include sensitive info)
BlackFuffey@reddit (OP)
It is in fact a 100ish line bash script that you can feel free to inspect.
HighRelevancy@reddit
Beware the what
audioen@reddit
Sounds like you may have reinvented zmodem accidentally. This stuff has existed for 40 years by this point.
HighRelevancy@reddit
I don't understand the use case exactly. You do "sqt -i some input" on one end and then "ssh -o me@host > somewhere" on the other. But why's that different to just "ssh me@host 'some input' > somewhere"?
BlackFuffey@reddit (OP)
The demo isn’t really clear on this. But the point is that it lets you tunnel from an existing interactive shell session. Meaning you get to keep your working directory and envs, have tab completion, history, or do something like
{ echo “foo”; sqt -o; } | …
BlackFuffey@reddit (OP)
The demo isn’t really clear on this. But the point is that it lets you tunnel from an existing interactive shell session. Meaning you get to keep your working directory and envs, have tab completion, history, or do something like
{ echo “foo”; sqt -o; } | …
Ollidav@reddit
Eso no es lo que hace sshpass?
mina86ng@reddit
I’d been using sshfs for remote use-cases, but I guess if that works for you, it works for you. Two things to consider: firstly, you clearly know what
ifstatements are — use them; secondly, you might detect automatically whether you need to read from or write to the pipe based on whether stdin and stdout are terminals.BlackFuffey@reddit (OP)
Auto detect is a good idea, I’ll add that. thanks!
aloobhujiyaay@reddit
SSH tunneling is one of those things that’s incredibly powerful but still feels annoyingly verbose for quick workflows