How to pass options to ssh proxy command?












2














To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication.
I may skip those which have no key authentication and ask for password, ssh/scp options do the job:



-o BatchMode=yes
or
-o PasswordAuthentication=no



But there are also hosts for which ssh proxy should be used, as it's set up in



/etc/ssh/ssh_config:



ProxyCommand /usr/bin/ssh -qW %h:%p <jumphost>



In such a case any ssh/scp options apply only to the first command and I still get a password prompt from the proxy command.



Is it possible to pass options to the proxy command (without editing the configuration file)?










share|improve this question
























  • I do not think so. But you can have host-specific ProxyCommand(s).
    – Martin Prikryl
    7 hours ago


















2














To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication.
I may skip those which have no key authentication and ask for password, ssh/scp options do the job:



-o BatchMode=yes
or
-o PasswordAuthentication=no



But there are also hosts for which ssh proxy should be used, as it's set up in



/etc/ssh/ssh_config:



ProxyCommand /usr/bin/ssh -qW %h:%p <jumphost>



In such a case any ssh/scp options apply only to the first command and I still get a password prompt from the proxy command.



Is it possible to pass options to the proxy command (without editing the configuration file)?










share|improve this question
























  • I do not think so. But you can have host-specific ProxyCommand(s).
    – Martin Prikryl
    7 hours ago
















2












2








2


1





To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication.
I may skip those which have no key authentication and ask for password, ssh/scp options do the job:



-o BatchMode=yes
or
-o PasswordAuthentication=no



But there are also hosts for which ssh proxy should be used, as it's set up in



/etc/ssh/ssh_config:



ProxyCommand /usr/bin/ssh -qW %h:%p <jumphost>



In such a case any ssh/scp options apply only to the first command and I still get a password prompt from the proxy command.



Is it possible to pass options to the proxy command (without editing the configuration file)?










share|improve this question















To collect some data from a bunch of hosts I use a bash script which calls scp in a loop. Most of these hosts are configured for ssh public key authentication.
I may skip those which have no key authentication and ask for password, ssh/scp options do the job:



-o BatchMode=yes
or
-o PasswordAuthentication=no



But there are also hosts for which ssh proxy should be used, as it's set up in



/etc/ssh/ssh_config:



ProxyCommand /usr/bin/ssh -qW %h:%p <jumphost>



In such a case any ssh/scp options apply only to the first command and I still get a password prompt from the proxy command.



Is it possible to pass options to the proxy command (without editing the configuration file)?







ssh scp proxy options






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 7 hours ago









Jeff Schaller

38.8k1053125




38.8k1053125










asked 7 hours ago









CrimsonPermanentAssurer

112




112












  • I do not think so. But you can have host-specific ProxyCommand(s).
    – Martin Prikryl
    7 hours ago




















  • I do not think so. But you can have host-specific ProxyCommand(s).
    – Martin Prikryl
    7 hours ago


















I do not think so. But you can have host-specific ProxyCommand(s).
– Martin Prikryl
7 hours ago






I do not think so. But you can have host-specific ProxyCommand(s).
– Martin Prikryl
7 hours ago












0






active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492242%2fhow-to-pass-options-to-ssh-proxy-command%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492242%2fhow-to-pass-options-to-ssh-proxy-command%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

CARDNET

Boot-repair Failure: Unable to locate package grub-common:i386

濃尾地震