As an experiment, I'm trying to write a script where I pipe a ZIP file into unzip
on my server via ssh
, however, what if I didn't have my SSH keys set up, and was prompted for a password? I'd still like it to come from stdin
, not from the ZIP file - THEN I want to pipe a ZIP file into unzip
, once the connection is established (maybe using two separate input pipes, one for the SSH password, one for the unzip
process that ssh
runs?).
Also, I'm currently writing into /tmp
on the server, then deleting, because unzip
doesn't seem to like /dev/stdin
on my server (I'm running Arch, the server is running Ubuntu 20.04). /dev/stdin
works when I pipe inside of the ssh
session, it works when I pipe on my machine, but not when I pipe FROM my machine, into ssh
. Any reason why?
ssh
command, you will need to take special steps as described in the question linked in Archemar's comment. – telcoM Sep 03 '21 at 06:07sshpass
utility to automate entering password for ssh. So it will probably work if you usesshpass
to provide password and pipe for the zip file. – raj Sep 03 '21 at 11:14plink
command that can be used as a replacement forssh
and it accepts password as parameter. – raj Sep 03 '21 at 11:17