There is a file on a remote host that I want to read across an ssh tunnel. NOT copy... scp won't work here. And this file requires elevated permissions to read.
'ssh -t remotehost sudo cat /path/to/file' will prompt me for my sudo password and read out the file. But I'm coming up blank for a way to capture that output. I really just need to grep and cut and sed my way through the output, so it doesn't matter how the content is available locally... writing to a temporary file is fine, or just streaming it across. But requiring the password to be entered puts the kybosh on every way of piping or redirecting the output I can think of. I can probably use a tar pipe to get it across, but it seems there ought to be an easier way to do this.