Passing multiple files through stdin (over ssh)Remote desktop (KDE) over SSH reverse tunnelMonitor via SSH and execute local script upon change detectionCorrectly parse arguments in script behaving like a shell called through SSHtransfer many similar files over sshssh some commands through (a variable amount of) intermediary hopsHow can I pass two files through ssh?How to pass data through existing SSH connection?Executing `sh -c` script through SSH (passing arguments safely and sanely)SCP copy through SSH not working - permission denied and stdin is not a ttyssh routing between multiple linux system containers transparently
A deadly disease, 95% of the population dead, suppresses or alters memory in unpredictable ways
Russian equivalents of "no love lost"
Where does "0 packages can be updated." come from?
Should I give professor gift at the beginning of my PhD?
My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?
How do governments keep track of their issued currency?
PhD - Well known professor or well known school?
Frame failure sudden death?
Preventing Employees from either switching to Competitors or Opening Their Own Business
What risks are there when you clear your cookies instead of logging off?
How did students remember what to practise between lessons without any sheet music?
How water is heavier than petrol eventhough its molecular weight less than petrol?
What can I, as a user, do about offensive reviews in App Store?
Different pedals/effects for low strings/notes than high
Words that signal future content
How to chain Python function calls so the behaviour is as follows
Trapping Rain Water
Arriving at the same result with the opposite hypotheses
What can plausibly explain many of my very long and low-tech bridges?
Payment instructions allegedly from HomeAway look fishy to me
Winning Strategy for the Magician and his Apprentice
Was the Tamarian language in "Darmok" inspired by Jack Vance's "The Asutra"?
Implement Homestuck's Catenative Doomsday Dice Cascader
Cross-dimension teleportation using command block or datapack?
Passing multiple files through stdin (over ssh)
Remote desktop (KDE) over SSH reverse tunnelMonitor via SSH and execute local script upon change detectionCorrectly parse arguments in script behaving like a shell called through SSHtransfer many similar files over sshssh some commands through (a variable amount of) intermediary hopsHow can I pass two files through ssh?How to pass data through existing SSH connection?Executing `sh -c` script through SSH (passing arguments safely and sanely)SCP copy through SSH not working - permission denied and stdin is not a ttyssh routing between multiple linux system containers transparently
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a program on a remote host, whose execution I need to automate. The command execute that program, on the same machine, looks something like this:
/path/to/program -a file1.txt -b file2.txt
In this case, file1.txt
and file2.txt
are used for entirely different things within the program, so I can't just cat
them together. However, in my case, the file1.txt
and file2.txt
that I want to pass into the program exist only on my device, not on the host where I need to execute the program. I know that I can feed at least one file through SSH by passing it through stdin
:
cat file1.txt | ssh host.name /path/to/program -a /dev/stdin -b file2.txt
but, since I'm not allowed to store files on the host, I need a way to get the file2.txt
over there as well. I'm thinking it might be possible through abuse of environment variables and creative use of cat
and sed
together, but I don't know the tools well enough to understand how I would use them to accomplish this. Is it doable, and how?
ssh io-redirection
New contributor
add a comment |
I have a program on a remote host, whose execution I need to automate. The command execute that program, on the same machine, looks something like this:
/path/to/program -a file1.txt -b file2.txt
In this case, file1.txt
and file2.txt
are used for entirely different things within the program, so I can't just cat
them together. However, in my case, the file1.txt
and file2.txt
that I want to pass into the program exist only on my device, not on the host where I need to execute the program. I know that I can feed at least one file through SSH by passing it through stdin
:
cat file1.txt | ssh host.name /path/to/program -a /dev/stdin -b file2.txt
but, since I'm not allowed to store files on the host, I need a way to get the file2.txt
over there as well. I'm thinking it might be possible through abuse of environment variables and creative use of cat
and sed
together, but I don't know the tools well enough to understand how I would use them to accomplish this. Is it doable, and how?
ssh io-redirection
New contributor
1
cat
andsed
are not the solution here.
– Slyx
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago
add a comment |
I have a program on a remote host, whose execution I need to automate. The command execute that program, on the same machine, looks something like this:
/path/to/program -a file1.txt -b file2.txt
In this case, file1.txt
and file2.txt
are used for entirely different things within the program, so I can't just cat
them together. However, in my case, the file1.txt
and file2.txt
that I want to pass into the program exist only on my device, not on the host where I need to execute the program. I know that I can feed at least one file through SSH by passing it through stdin
:
cat file1.txt | ssh host.name /path/to/program -a /dev/stdin -b file2.txt
but, since I'm not allowed to store files on the host, I need a way to get the file2.txt
over there as well. I'm thinking it might be possible through abuse of environment variables and creative use of cat
and sed
together, but I don't know the tools well enough to understand how I would use them to accomplish this. Is it doable, and how?
ssh io-redirection
New contributor
I have a program on a remote host, whose execution I need to automate. The command execute that program, on the same machine, looks something like this:
/path/to/program -a file1.txt -b file2.txt
In this case, file1.txt
and file2.txt
are used for entirely different things within the program, so I can't just cat
them together. However, in my case, the file1.txt
and file2.txt
that I want to pass into the program exist only on my device, not on the host where I need to execute the program. I know that I can feed at least one file through SSH by passing it through stdin
:
cat file1.txt | ssh host.name /path/to/program -a /dev/stdin -b file2.txt
but, since I'm not allowed to store files on the host, I need a way to get the file2.txt
over there as well. I'm thinking it might be possible through abuse of environment variables and creative use of cat
and sed
together, but I don't know the tools well enough to understand how I would use them to accomplish this. Is it doable, and how?
ssh io-redirection
ssh io-redirection
New contributor
New contributor
New contributor
asked 8 hours ago
Green Cloak GuyGreen Cloak Guy
1163
1163
New contributor
New contributor
1
cat
andsed
are not the solution here.
– Slyx
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago
add a comment |
1
cat
andsed
are not the solution here.
– Slyx
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago
1
1
cat
and sed
are not the solution here.– Slyx
8 hours ago
cat
and sed
are not the solution here.– Slyx
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago
add a comment |
5 Answers
5
active
oldest
votes
If the files given as arguments to your program are text files, and you're able to control their content (you know a line which doesn't occur inside them), you can use multiple here-documents:
echo "cat /dev/fd/3 3<<'EOT' /dev/fd/4 4<<'EOT' /dev/fd/5 5<<'EOT'"
cat file1
echo EOT
cat file2
echo EOT
cat file3
echo EOT
| ssh user@host sh
Here cat
is a sample command which takes filenames as arguments. It could be instead:
echo "/path/to/prog -a /dev/fd/3 3<<'EOT' -b /dev/fd/4 4<<'EOT'
Replace each EOT
with something that doesn't occur in each of the files, respectively.
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
add a comment |
If you can set a TCP listener (can be a higher port), then you could use a second SSH session to establish the second input source with nc
.
Example:
There's this script on the server (~/script.bash
):
#!/usr/bin/env bash
cat "$1" | tr a 1
nc localhost "$2" | tr '[:lower:]' '[:upper:]'
And there are these two files locally:
$ cat a
aaa
aaa
aaa
$ cat b
bbb
bbb
bbb
Now first start the second source ($serv
is the server):
ssh "$serv" nc -l -p 2222 -q1 <b &
And run the command proper:
$ ssh "$serv" ./script.bash - 2222 <a
111
111
111
BBB
BBB
BBB
[1]+ Done ssh "$serv" nc -l -p 2222 -q1 < b
add a comment |
Unfortunately there's not a great way to do this directly, since the ssh
client will only pass the three file descriptors (stdin
, stdout
and stderr
) to the server and it doesn't have provisions to pass additional file descriptors (which would be helpful for this particular use case.)
(Also note that the SSH protocol has provisions to pass additional file descriptors, only the ssh
client doesn't implement a way to use that feature. Theoretically, extending the client with a patch would be enough to expose this feature.)
One hacky way to accomplish what you're looking for is to use file descriptor 2 (the stderr
file descriptor) to pass the second file. Something like:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/stderr
<file1.txt 2<file2.txt
This should work, it just might cause an issue if program
tries to write to stderr. You can work around that by re-juggling the file descriptors on the remote end before you run program. You can move file2.txt
to file descriptor 3 and re-open stderr to mirror stdout:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/fd/3
'3<&2' '2>&1'
<file1.txt 2<file2.txt
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)
– Stéphane Chazelas
6 hours ago
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred viaSSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set toSSH_EXTENDED_DATA_STDERR
. You can read the whole thing here
– mosvy
5 hours ago
|
show 4 more comments
If you're allowed to forward ports over ssh
, and you have access to wget
on the remote machine and to busybox
on the local machine, you can do something like:
mkdir /tmp/test; cd /tmp/test
echo 1st_file > 1st_file
echo 2nd_file > 2nd_file
busybox httpd -f -p 127.0.0.1:11080 &
ssh USER@HOST -R 10080:127.0.0.1:11080 '
cat <(wget -q -O- http://localhost:10080/1st_file)
<(wget -q -O- http://localhost:10080/2nd_file)
'
kill $!
(using cat
as an example program which takes two file arguments).
Only the ability to forward ports via -R
is essential -- instead of doing http, you can use other methods (2 netcat
s and 2 forwardings, /dev/tcp/
in bash
on the remote side, etc). But convincing a netcat
without the -N
option to close the connection proved to be much messier than I though.
There may be ways to replace the <(...)
process subtitutions if the shell on the remote machine isn't ksh- or bash- like.
All in all, this isn't too great -- better knowledge about the exact system/shells/config/permissions (which you haven't provided) could allow for smarter solutions.
add a comment |
Perhaps not exactly what you want... But maybe consider sending a tarball through the pipe opened by ssh?
You said that:
I'm not allowed to store files on the host.
It's possible that you don't have a writable home directory or other convenient location to store files long term, but I'd say it's unlikely you don't have any writable location, even if a temporary tmpfs
that will be made available only for your particular connection.
Many programs (and even libc routines) require a writable /tmp
, so it's very likely one will be available to you.
Then you could use a script that will unpack the tarball into a temporary directory, run your program and cleanup through the ssh connection.
Something like:
$ tar cf - file1.txt file2.txt |
ssh host.name '
set -e
tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup () rm -rf "$tmpdir";
trap cleanup EXIT
cd "$tmpdir"
tar xf -
/path/to/program -a file1.txt -b file2.txt
'
This might need some extra care with file paths and there are some corner cases to consider (test for them), but the general approach should work.
If no writable directory is available, a possible approach would be to modify program
to take a tarball as single input and unpack its contents to memory. For instance, if program
is a Python script, then using the built-in tarfile
module would easily accomplish something like that.
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to/tmp/
and use it directly.
– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Green Cloak Guy is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f522637%2fpassing-multiple-files-through-stdin-over-ssh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
If the files given as arguments to your program are text files, and you're able to control their content (you know a line which doesn't occur inside them), you can use multiple here-documents:
echo "cat /dev/fd/3 3<<'EOT' /dev/fd/4 4<<'EOT' /dev/fd/5 5<<'EOT'"
cat file1
echo EOT
cat file2
echo EOT
cat file3
echo EOT
| ssh user@host sh
Here cat
is a sample command which takes filenames as arguments. It could be instead:
echo "/path/to/prog -a /dev/fd/3 3<<'EOT' -b /dev/fd/4 4<<'EOT'
Replace each EOT
with something that doesn't occur in each of the files, respectively.
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
add a comment |
If the files given as arguments to your program are text files, and you're able to control their content (you know a line which doesn't occur inside them), you can use multiple here-documents:
echo "cat /dev/fd/3 3<<'EOT' /dev/fd/4 4<<'EOT' /dev/fd/5 5<<'EOT'"
cat file1
echo EOT
cat file2
echo EOT
cat file3
echo EOT
| ssh user@host sh
Here cat
is a sample command which takes filenames as arguments. It could be instead:
echo "/path/to/prog -a /dev/fd/3 3<<'EOT' -b /dev/fd/4 4<<'EOT'
Replace each EOT
with something that doesn't occur in each of the files, respectively.
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
add a comment |
If the files given as arguments to your program are text files, and you're able to control their content (you know a line which doesn't occur inside them), you can use multiple here-documents:
echo "cat /dev/fd/3 3<<'EOT' /dev/fd/4 4<<'EOT' /dev/fd/5 5<<'EOT'"
cat file1
echo EOT
cat file2
echo EOT
cat file3
echo EOT
| ssh user@host sh
Here cat
is a sample command which takes filenames as arguments. It could be instead:
echo "/path/to/prog -a /dev/fd/3 3<<'EOT' -b /dev/fd/4 4<<'EOT'
Replace each EOT
with something that doesn't occur in each of the files, respectively.
If the files given as arguments to your program are text files, and you're able to control their content (you know a line which doesn't occur inside them), you can use multiple here-documents:
echo "cat /dev/fd/3 3<<'EOT' /dev/fd/4 4<<'EOT' /dev/fd/5 5<<'EOT'"
cat file1
echo EOT
cat file2
echo EOT
cat file3
echo EOT
| ssh user@host sh
Here cat
is a sample command which takes filenames as arguments. It could be instead:
echo "/path/to/prog -a /dev/fd/3 3<<'EOT' -b /dev/fd/4 4<<'EOT'
Replace each EOT
with something that doesn't occur in each of the files, respectively.
answered 2 hours ago
mosvymosvy
12.4k11542
12.4k11542
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
add a comment |
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
This approach is quite clever! If the files are not text, you could encode/decode them with something like base64 or even good ol' uuencode... Very nice!
– filbranden
2 hours ago
add a comment |
If you can set a TCP listener (can be a higher port), then you could use a second SSH session to establish the second input source with nc
.
Example:
There's this script on the server (~/script.bash
):
#!/usr/bin/env bash
cat "$1" | tr a 1
nc localhost "$2" | tr '[:lower:]' '[:upper:]'
And there are these two files locally:
$ cat a
aaa
aaa
aaa
$ cat b
bbb
bbb
bbb
Now first start the second source ($serv
is the server):
ssh "$serv" nc -l -p 2222 -q1 <b &
And run the command proper:
$ ssh "$serv" ./script.bash - 2222 <a
111
111
111
BBB
BBB
BBB
[1]+ Done ssh "$serv" nc -l -p 2222 -q1 < b
add a comment |
If you can set a TCP listener (can be a higher port), then you could use a second SSH session to establish the second input source with nc
.
Example:
There's this script on the server (~/script.bash
):
#!/usr/bin/env bash
cat "$1" | tr a 1
nc localhost "$2" | tr '[:lower:]' '[:upper:]'
And there are these two files locally:
$ cat a
aaa
aaa
aaa
$ cat b
bbb
bbb
bbb
Now first start the second source ($serv
is the server):
ssh "$serv" nc -l -p 2222 -q1 <b &
And run the command proper:
$ ssh "$serv" ./script.bash - 2222 <a
111
111
111
BBB
BBB
BBB
[1]+ Done ssh "$serv" nc -l -p 2222 -q1 < b
add a comment |
If you can set a TCP listener (can be a higher port), then you could use a second SSH session to establish the second input source with nc
.
Example:
There's this script on the server (~/script.bash
):
#!/usr/bin/env bash
cat "$1" | tr a 1
nc localhost "$2" | tr '[:lower:]' '[:upper:]'
And there are these two files locally:
$ cat a
aaa
aaa
aaa
$ cat b
bbb
bbb
bbb
Now first start the second source ($serv
is the server):
ssh "$serv" nc -l -p 2222 -q1 <b &
And run the command proper:
$ ssh "$serv" ./script.bash - 2222 <a
111
111
111
BBB
BBB
BBB
[1]+ Done ssh "$serv" nc -l -p 2222 -q1 < b
If you can set a TCP listener (can be a higher port), then you could use a second SSH session to establish the second input source with nc
.
Example:
There's this script on the server (~/script.bash
):
#!/usr/bin/env bash
cat "$1" | tr a 1
nc localhost "$2" | tr '[:lower:]' '[:upper:]'
And there are these two files locally:
$ cat a
aaa
aaa
aaa
$ cat b
bbb
bbb
bbb
Now first start the second source ($serv
is the server):
ssh "$serv" nc -l -p 2222 -q1 <b &
And run the command proper:
$ ssh "$serv" ./script.bash - 2222 <a
111
111
111
BBB
BBB
BBB
[1]+ Done ssh "$serv" nc -l -p 2222 -q1 < b
edited 5 hours ago
answered 8 hours ago
TomaszTomasz
10.5k73372
10.5k73372
add a comment |
add a comment |
Unfortunately there's not a great way to do this directly, since the ssh
client will only pass the three file descriptors (stdin
, stdout
and stderr
) to the server and it doesn't have provisions to pass additional file descriptors (which would be helpful for this particular use case.)
(Also note that the SSH protocol has provisions to pass additional file descriptors, only the ssh
client doesn't implement a way to use that feature. Theoretically, extending the client with a patch would be enough to expose this feature.)
One hacky way to accomplish what you're looking for is to use file descriptor 2 (the stderr
file descriptor) to pass the second file. Something like:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/stderr
<file1.txt 2<file2.txt
This should work, it just might cause an issue if program
tries to write to stderr. You can work around that by re-juggling the file descriptors on the remote end before you run program. You can move file2.txt
to file descriptor 3 and re-open stderr to mirror stdout:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/fd/3
'3<&2' '2>&1'
<file1.txt 2<file2.txt
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)
– Stéphane Chazelas
6 hours ago
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred viaSSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set toSSH_EXTENDED_DATA_STDERR
. You can read the whole thing here
– mosvy
5 hours ago
|
show 4 more comments
Unfortunately there's not a great way to do this directly, since the ssh
client will only pass the three file descriptors (stdin
, stdout
and stderr
) to the server and it doesn't have provisions to pass additional file descriptors (which would be helpful for this particular use case.)
(Also note that the SSH protocol has provisions to pass additional file descriptors, only the ssh
client doesn't implement a way to use that feature. Theoretically, extending the client with a patch would be enough to expose this feature.)
One hacky way to accomplish what you're looking for is to use file descriptor 2 (the stderr
file descriptor) to pass the second file. Something like:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/stderr
<file1.txt 2<file2.txt
This should work, it just might cause an issue if program
tries to write to stderr. You can work around that by re-juggling the file descriptors on the remote end before you run program. You can move file2.txt
to file descriptor 3 and re-open stderr to mirror stdout:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/fd/3
'3<&2' '2>&1'
<file1.txt 2<file2.txt
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)
– Stéphane Chazelas
6 hours ago
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred viaSSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set toSSH_EXTENDED_DATA_STDERR
. You can read the whole thing here
– mosvy
5 hours ago
|
show 4 more comments
Unfortunately there's not a great way to do this directly, since the ssh
client will only pass the three file descriptors (stdin
, stdout
and stderr
) to the server and it doesn't have provisions to pass additional file descriptors (which would be helpful for this particular use case.)
(Also note that the SSH protocol has provisions to pass additional file descriptors, only the ssh
client doesn't implement a way to use that feature. Theoretically, extending the client with a patch would be enough to expose this feature.)
One hacky way to accomplish what you're looking for is to use file descriptor 2 (the stderr
file descriptor) to pass the second file. Something like:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/stderr
<file1.txt 2<file2.txt
This should work, it just might cause an issue if program
tries to write to stderr. You can work around that by re-juggling the file descriptors on the remote end before you run program. You can move file2.txt
to file descriptor 3 and re-open stderr to mirror stdout:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/fd/3
'3<&2' '2>&1'
<file1.txt 2<file2.txt
Unfortunately there's not a great way to do this directly, since the ssh
client will only pass the three file descriptors (stdin
, stdout
and stderr
) to the server and it doesn't have provisions to pass additional file descriptors (which would be helpful for this particular use case.)
(Also note that the SSH protocol has provisions to pass additional file descriptors, only the ssh
client doesn't implement a way to use that feature. Theoretically, extending the client with a patch would be enough to expose this feature.)
One hacky way to accomplish what you're looking for is to use file descriptor 2 (the stderr
file descriptor) to pass the second file. Something like:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/stderr
<file1.txt 2<file2.txt
This should work, it just might cause an issue if program
tries to write to stderr. You can work around that by re-juggling the file descriptors on the remote end before you run program. You can move file2.txt
to file descriptor 3 and re-open stderr to mirror stdout:
$ ssh remote.name
/path/to/program -a /dev/stdin -b /dev/fd/3
'3<&2' '2>&1'
<file1.txt 2<file2.txt
answered 7 hours ago
filbrandenfilbranden
11.6k21849
11.6k21849
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)
– Stéphane Chazelas
6 hours ago
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred viaSSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set toSSH_EXTENDED_DATA_STDERR
. You can read the whole thing here
– mosvy
5 hours ago
|
show 4 more comments
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)
– Stéphane Chazelas
6 hours ago
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred viaSSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set toSSH_EXTENDED_DATA_STDERR
. You can read the whole thing here
– mosvy
5 hours ago
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
I haven't really tested this (typing on a phone) but at least in theory I'd expect it to work. Let me know if for some reason it doesn't. Cheers!
– filbranden
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
That won't work at all. Not even with a hacked ssh. AFAIK stderr doesn't use a separate channel, but some special kind of message. But yes, being able to access ssh channels as pipes or unnamed unix domain sockets (instead of having to do socket forwardings) would be great, it just doesn't seem to be possible in any kind or shape.
– mosvy
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
@mosvy, fd 0, 1 and 2 on the remote command will be 3 different pipes. The data travels through 3 different channels multiplexed in the ssh connection, but those are uni-directional (from client to sever for fd 0 and from server to client for 1 and 2), so even on systems where pipes are bidirectional, that won't work. On Linux, openening /dev/stderr in readonly mode gives on the other end of the pipe, so it would never work either.
– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (
3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)– Stéphane Chazelas
6 hours ago
Note that the last one assumes the login shell of the user on remote.name is Bourne-like (
3<&2
is a Bourne shell operator, and sshd runs the login shell of the user to interpret the command sent by the client)– Stéphane Chazelas
6 hours ago
1
1
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred via
SSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set to SSH_EXTENDED_DATA_STDERR
. You can read the whole thing here– mosvy
5 hours ago
@StéphaneChazelas Nope, a single ssh channel is used for stdin/stdout/stderr, and the stderr data is transferred via
SSH_MSG_CHANNEL_EXTENDED_DATA
messages with the type set to SSH_EXTENDED_DATA_STDERR
. You can read the whole thing here– mosvy
5 hours ago
|
show 4 more comments
If you're allowed to forward ports over ssh
, and you have access to wget
on the remote machine and to busybox
on the local machine, you can do something like:
mkdir /tmp/test; cd /tmp/test
echo 1st_file > 1st_file
echo 2nd_file > 2nd_file
busybox httpd -f -p 127.0.0.1:11080 &
ssh USER@HOST -R 10080:127.0.0.1:11080 '
cat <(wget -q -O- http://localhost:10080/1st_file)
<(wget -q -O- http://localhost:10080/2nd_file)
'
kill $!
(using cat
as an example program which takes two file arguments).
Only the ability to forward ports via -R
is essential -- instead of doing http, you can use other methods (2 netcat
s and 2 forwardings, /dev/tcp/
in bash
on the remote side, etc). But convincing a netcat
without the -N
option to close the connection proved to be much messier than I though.
There may be ways to replace the <(...)
process subtitutions if the shell on the remote machine isn't ksh- or bash- like.
All in all, this isn't too great -- better knowledge about the exact system/shells/config/permissions (which you haven't provided) could allow for smarter solutions.
add a comment |
If you're allowed to forward ports over ssh
, and you have access to wget
on the remote machine and to busybox
on the local machine, you can do something like:
mkdir /tmp/test; cd /tmp/test
echo 1st_file > 1st_file
echo 2nd_file > 2nd_file
busybox httpd -f -p 127.0.0.1:11080 &
ssh USER@HOST -R 10080:127.0.0.1:11080 '
cat <(wget -q -O- http://localhost:10080/1st_file)
<(wget -q -O- http://localhost:10080/2nd_file)
'
kill $!
(using cat
as an example program which takes two file arguments).
Only the ability to forward ports via -R
is essential -- instead of doing http, you can use other methods (2 netcat
s and 2 forwardings, /dev/tcp/
in bash
on the remote side, etc). But convincing a netcat
without the -N
option to close the connection proved to be much messier than I though.
There may be ways to replace the <(...)
process subtitutions if the shell on the remote machine isn't ksh- or bash- like.
All in all, this isn't too great -- better knowledge about the exact system/shells/config/permissions (which you haven't provided) could allow for smarter solutions.
add a comment |
If you're allowed to forward ports over ssh
, and you have access to wget
on the remote machine and to busybox
on the local machine, you can do something like:
mkdir /tmp/test; cd /tmp/test
echo 1st_file > 1st_file
echo 2nd_file > 2nd_file
busybox httpd -f -p 127.0.0.1:11080 &
ssh USER@HOST -R 10080:127.0.0.1:11080 '
cat <(wget -q -O- http://localhost:10080/1st_file)
<(wget -q -O- http://localhost:10080/2nd_file)
'
kill $!
(using cat
as an example program which takes two file arguments).
Only the ability to forward ports via -R
is essential -- instead of doing http, you can use other methods (2 netcat
s and 2 forwardings, /dev/tcp/
in bash
on the remote side, etc). But convincing a netcat
without the -N
option to close the connection proved to be much messier than I though.
There may be ways to replace the <(...)
process subtitutions if the shell on the remote machine isn't ksh- or bash- like.
All in all, this isn't too great -- better knowledge about the exact system/shells/config/permissions (which you haven't provided) could allow for smarter solutions.
If you're allowed to forward ports over ssh
, and you have access to wget
on the remote machine and to busybox
on the local machine, you can do something like:
mkdir /tmp/test; cd /tmp/test
echo 1st_file > 1st_file
echo 2nd_file > 2nd_file
busybox httpd -f -p 127.0.0.1:11080 &
ssh USER@HOST -R 10080:127.0.0.1:11080 '
cat <(wget -q -O- http://localhost:10080/1st_file)
<(wget -q -O- http://localhost:10080/2nd_file)
'
kill $!
(using cat
as an example program which takes two file arguments).
Only the ability to forward ports via -R
is essential -- instead of doing http, you can use other methods (2 netcat
s and 2 forwardings, /dev/tcp/
in bash
on the remote side, etc). But convincing a netcat
without the -N
option to close the connection proved to be much messier than I though.
There may be ways to replace the <(...)
process subtitutions if the shell on the remote machine isn't ksh- or bash- like.
All in all, this isn't too great -- better knowledge about the exact system/shells/config/permissions (which you haven't provided) could allow for smarter solutions.
edited 3 hours ago
answered 4 hours ago
mosvymosvy
12.4k11542
12.4k11542
add a comment |
add a comment |
Perhaps not exactly what you want... But maybe consider sending a tarball through the pipe opened by ssh?
You said that:
I'm not allowed to store files on the host.
It's possible that you don't have a writable home directory or other convenient location to store files long term, but I'd say it's unlikely you don't have any writable location, even if a temporary tmpfs
that will be made available only for your particular connection.
Many programs (and even libc routines) require a writable /tmp
, so it's very likely one will be available to you.
Then you could use a script that will unpack the tarball into a temporary directory, run your program and cleanup through the ssh connection.
Something like:
$ tar cf - file1.txt file2.txt |
ssh host.name '
set -e
tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup () rm -rf "$tmpdir";
trap cleanup EXIT
cd "$tmpdir"
tar xf -
/path/to/program -a file1.txt -b file2.txt
'
This might need some extra care with file paths and there are some corner cases to consider (test for them), but the general approach should work.
If no writable directory is available, a possible approach would be to modify program
to take a tarball as single input and unpack its contents to memory. For instance, if program
is a Python script, then using the built-in tarfile
module would easily accomplish something like that.
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to/tmp/
and use it directly.
– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
add a comment |
Perhaps not exactly what you want... But maybe consider sending a tarball through the pipe opened by ssh?
You said that:
I'm not allowed to store files on the host.
It's possible that you don't have a writable home directory or other convenient location to store files long term, but I'd say it's unlikely you don't have any writable location, even if a temporary tmpfs
that will be made available only for your particular connection.
Many programs (and even libc routines) require a writable /tmp
, so it's very likely one will be available to you.
Then you could use a script that will unpack the tarball into a temporary directory, run your program and cleanup through the ssh connection.
Something like:
$ tar cf - file1.txt file2.txt |
ssh host.name '
set -e
tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup () rm -rf "$tmpdir";
trap cleanup EXIT
cd "$tmpdir"
tar xf -
/path/to/program -a file1.txt -b file2.txt
'
This might need some extra care with file paths and there are some corner cases to consider (test for them), but the general approach should work.
If no writable directory is available, a possible approach would be to modify program
to take a tarball as single input and unpack its contents to memory. For instance, if program
is a Python script, then using the built-in tarfile
module would easily accomplish something like that.
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to/tmp/
and use it directly.
– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
add a comment |
Perhaps not exactly what you want... But maybe consider sending a tarball through the pipe opened by ssh?
You said that:
I'm not allowed to store files on the host.
It's possible that you don't have a writable home directory or other convenient location to store files long term, but I'd say it's unlikely you don't have any writable location, even if a temporary tmpfs
that will be made available only for your particular connection.
Many programs (and even libc routines) require a writable /tmp
, so it's very likely one will be available to you.
Then you could use a script that will unpack the tarball into a temporary directory, run your program and cleanup through the ssh connection.
Something like:
$ tar cf - file1.txt file2.txt |
ssh host.name '
set -e
tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup () rm -rf "$tmpdir";
trap cleanup EXIT
cd "$tmpdir"
tar xf -
/path/to/program -a file1.txt -b file2.txt
'
This might need some extra care with file paths and there are some corner cases to consider (test for them), but the general approach should work.
If no writable directory is available, a possible approach would be to modify program
to take a tarball as single input and unpack its contents to memory. For instance, if program
is a Python script, then using the built-in tarfile
module would easily accomplish something like that.
Perhaps not exactly what you want... But maybe consider sending a tarball through the pipe opened by ssh?
You said that:
I'm not allowed to store files on the host.
It's possible that you don't have a writable home directory or other convenient location to store files long term, but I'd say it's unlikely you don't have any writable location, even if a temporary tmpfs
that will be made available only for your particular connection.
Many programs (and even libc routines) require a writable /tmp
, so it's very likely one will be available to you.
Then you could use a script that will unpack the tarball into a temporary directory, run your program and cleanup through the ssh connection.
Something like:
$ tar cf - file1.txt file2.txt |
ssh host.name '
set -e
tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup () rm -rf "$tmpdir";
trap cleanup EXIT
cd "$tmpdir"
tar xf -
/path/to/program -a file1.txt -b file2.txt
'
This might need some extra care with file paths and there are some corner cases to consider (test for them), but the general approach should work.
If no writable directory is available, a possible approach would be to modify program
to take a tarball as single input and unpack its contents to memory. For instance, if program
is a Python script, then using the built-in tarfile
module would easily accomplish something like that.
answered 2 hours ago
filbrandenfilbranden
11.6k21849
11.6k21849
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to/tmp/
and use it directly.
– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
add a comment |
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to/tmp/
and use it directly.
– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
1
1
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to
/tmp/
and use it directly.– Green Cloak Guy
2 hours ago
Even without going through the trouble of tarballing it - I've decided more or less to just write a file to
/tmp/
and use it directly.– Green Cloak Guy
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
The tarball approach has some advantages, as you use a single ssh connection (no need to test for success/failure) and multiple concurrent runs are not likely to run into each other (use and/or delete files in /tmp meant for separate runs.) But I think that's the best you'll get from ssh as it exists now. Good luck!
– filbranden
2 hours ago
1
1
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
@GreenCloakGuy So after all, you can store files on the server just fine. Please modify the question accordingly.
– mosvy
2 hours ago
add a comment |
Green Cloak Guy is a new contributor. Be nice, and check out our Code of Conduct.
Green Cloak Guy is a new contributor. Be nice, and check out our Code of Conduct.
Green Cloak Guy is a new contributor. Be nice, and check out our Code of Conduct.
Green Cloak Guy is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f522637%2fpassing-multiple-files-through-stdin-over-ssh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
cat
andsed
are not the solution here.– Slyx
8 hours ago
Probably I'd be able to mount, but given proxies and security constraints I'm not sure I'd be able to get away with it.
– Green Cloak Guy
8 hours ago
Do you have the permission in the remote machine to mount an ssh folder?
– Slyx
8 hours ago
if you can open an ssh session from the remote machine to your local one, so there's no issue at the network level to mount an SSH folder.
– Slyx
8 hours ago
Can you do forwardings? What systems and shells do you have at the local and the remote end?
– mosvy
6 hours ago