[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

streaming over ssh and decrypting a file



I am trying do something like
$ ssh kornak "cat markov/turtle.Lenny00.gpg" | gpg -d - | sudo cmp -
/dev/turtle/Lenny00

But that doesn't work, nor do even simpler versions.  How can I
achieve the goal which is to
1. stream the file from the remote system (kornak) to the local system (markov).
2. decrypt the stream.
3. cmp the decrypted stream to the original device /dev/turtle/Lenny00
(a logical volume).  root privileges are necessary to access the
device.

markov has insufficient room to hold the backup, and so I need to
stream it.  There seems to be something about  the prompts that cause
the process to hang.

Everything is operating within a session that has ssh-agent running,
since the prompting needed by ssh was also screwing things up.  Even a
simpler version without sudo fails:

# this works fine--no prompts
ross@markov:~$ ssh kornak "cat markov/turtle.Lenny00.gpg" | head -c 20 | hd

#this doesn't-- gpg prompts
ross@markov:~$ ssh kornak "cat markov/turtle.Lenny00.gpg" | gpg -d - |
head -c 20 | hd

You need a passphrase to unlock the secret key for
user: "Ross Boylan (work) <Ross.Boylan@ucsf.edu>"
2048-bit ELG-E key, ID xxx created 2014-09-17 (main key ID yyy)

Enter passphrase:
# After entering the passphrase, nothing happens
# No activity on remote or local system
# After several minutes I hit ^c
gpg: Interrupt caught ... exiting

Thanks.
Ross Boylan

P.S. files created with
ross@markov:~$ date; time sudo cat /dev/turtle/Lenny00 | gpg -e -r
Ross.Boylan@ucsf.edu | ssh kornak "cat > markov/turtle.Lenny00.gpg"
This needed to be within an ssh-agent session to avoid getting prompts
from ssh and gpg, which seemed to step on each other.
Note that it does require a gpg prompt.


Reply to: