Sample Header Ad - 728x90

Prompt for ssh password if needed, then pipe into the ssh session

2 votes
1 answer
3399 views
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?
Asked by Liran (21 rep)
Sep 3, 2021, 05:01 AM
Last activity: Jan 8, 2025, 10:07 PM