I'd like to pipe several files to a remote server, piped as input to commands run on the remote server, over ssh, but only one ssh connection/command is permitted. (In the remote authorized_keys file, "command=..." is specified, so only one single command/script can be run on the remote end using that key).
Is it possible to have a setup where multiple files go in the same pipe - I've been considering tar'ing them and having some logic in the remote script/untar to separate the files to separate commands
The initial setup was something like
cat file1 | ssh -i identity remote.host 'remote command1 <'
cat file2 | ssh -i identity remote.host 'remote command2 <'
...etc
Using tar, it could be something like
tar cf - file1 file2 file3 | ssh -i identity remote.host 'remote command.sh <'
The remote script would need to be able to extract the files one by one and pipe the data into separate commands, but I am not sure how to achieve this