Are host configurations in the SSH config merged?What's the difference between Host and HostName in SSH...
How to delete multiple process id of a single process?
I'm feeling like my character doesn't fit the campaign
As a supervisor, what feedback would you expect from a PhD who quits?
Why do most airliners have underwing engines, while business jets have rear-mounted engines?
Any way to meet code with 40.7% or 40.44% conduit fill?
Earliest example of double planets in science fiction?
What is the shape of the upper boundary of water hitting a screen?
What do I need to see before Spider-Man: Far From Home?
How did the IEC decide to create kibibytes?
Machine Learning Golf: Multiplication
How do I check that users don't write down their passwords?
How do I talk to my wife about unrealistic expectations?
Can you create a free-floating MASYU puzzle?
Initializing variables in an "if" statement
Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?
What are some bad ways to subvert tropes?
What happens if the limit of 4 billion files was exceeded in an ext4 partition?
Chilling juice in copper vessel
Possibility to correct pitch from digital versions of records with the hole not centered
Wearing special clothes in public while in niddah- isn't this a lack of tznius?
Minor differences between two recorded guitars
Implicit conversion between decimals with different precisions
What's the big deal about the Nazgûl losing their horses?
Who goes first? Person disembarking bus or the bicycle?
Are host configurations in the SSH config merged?
What's the difference between Host and HostName in SSH Config?SSH Config setting default user for multiple hosts under the same domain + aliasesHow can I make OSX terminal tab names the same as .ssh/config host aliasesSSH 'Host key verification failed' errorOpenSSH ~/.ssh/config host-specific overrides not workingHow can I force SSH to ignore the IdentityFile listed in “Host *” for one specific host?ssh config with sudoWhat may cause .ssh/config changes to be ignoredSSH is not picking a more specific match from ~/.ssh/configAliases in .ssh/config
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have the following generic host configuration in my .ssh/ssh_config
:
Host *
ConnectTimeout 5
ServerAliveInterval 5
ServerAliveCountMax 12
I also have some specific configurations. For example the following alias:
Host work-server-1
Hostname a.b.c.d
Host work-server-2
Hostname i.j.k.l
Now, my question: when logging into the host work-server-1
, will SSH also use the ConnectTimeout
, ServerAliveInterval
and ServerAliveCountMax
setting as defined in the Host *
entry?
linux networking ssh openssh
New contributor
add a comment |
I have the following generic host configuration in my .ssh/ssh_config
:
Host *
ConnectTimeout 5
ServerAliveInterval 5
ServerAliveCountMax 12
I also have some specific configurations. For example the following alias:
Host work-server-1
Hostname a.b.c.d
Host work-server-2
Hostname i.j.k.l
Now, my question: when logging into the host work-server-1
, will SSH also use the ConnectTimeout
, ServerAliveInterval
and ServerAliveCountMax
setting as defined in the Host *
entry?
linux networking ssh openssh
New contributor
add a comment |
I have the following generic host configuration in my .ssh/ssh_config
:
Host *
ConnectTimeout 5
ServerAliveInterval 5
ServerAliveCountMax 12
I also have some specific configurations. For example the following alias:
Host work-server-1
Hostname a.b.c.d
Host work-server-2
Hostname i.j.k.l
Now, my question: when logging into the host work-server-1
, will SSH also use the ConnectTimeout
, ServerAliveInterval
and ServerAliveCountMax
setting as defined in the Host *
entry?
linux networking ssh openssh
New contributor
I have the following generic host configuration in my .ssh/ssh_config
:
Host *
ConnectTimeout 5
ServerAliveInterval 5
ServerAliveCountMax 12
I also have some specific configurations. For example the following alias:
Host work-server-1
Hostname a.b.c.d
Host work-server-2
Hostname i.j.k.l
Now, my question: when logging into the host work-server-1
, will SSH also use the ConnectTimeout
, ServerAliveInterval
and ServerAliveCountMax
setting as defined in the Host *
entry?
linux networking ssh openssh
linux networking ssh openssh
New contributor
New contributor
edited 7 hours ago
Martin Prikryl
12.2k4 gold badges37 silver badges85 bronze badges
12.2k4 gold badges37 silver badges85 bronze badges
New contributor
asked 8 hours ago
PritzlPritzl
132 bronze badges
132 bronze badges
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
For each directive, the first relevant occurrence in the ssh_config
is used.
Quoting man page for ssh_config
:
For each parameter, the first obtained value will be used. The configuration files contain sections separated by
Host
specifications, and that section is only applied for hosts that match one of the patterns given in the specification. ...
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
So with the configuration file below:
- For all hosts,
ServerAliveInterval 1
is always used,4
and7
are never used, not even forwork
.
ConnectTimeout
is2
forwork
, for other hosts it's3
.- For all hosts, the
ServerAliveCountMax
is5
, thework
-specific value6
is never used, not even forwork
.
ServerAliveInterval 1
Host work
ConnectTimeout 2
Host *
ConnectTimeout 3
ServerAliveInterval 4
ServerAliveCountMax 5
Host work
ServerAliveCountMax 6
ServerAliveInterval 7
1
Much obliged Martin.
– Pritzl
7 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
Pritzl 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%2fsuperuser.com%2fquestions%2f1456255%2fare-host-configurations-in-the-ssh-config-merged%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For each directive, the first relevant occurrence in the ssh_config
is used.
Quoting man page for ssh_config
:
For each parameter, the first obtained value will be used. The configuration files contain sections separated by
Host
specifications, and that section is only applied for hosts that match one of the patterns given in the specification. ...
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
So with the configuration file below:
- For all hosts,
ServerAliveInterval 1
is always used,4
and7
are never used, not even forwork
.
ConnectTimeout
is2
forwork
, for other hosts it's3
.- For all hosts, the
ServerAliveCountMax
is5
, thework
-specific value6
is never used, not even forwork
.
ServerAliveInterval 1
Host work
ConnectTimeout 2
Host *
ConnectTimeout 3
ServerAliveInterval 4
ServerAliveCountMax 5
Host work
ServerAliveCountMax 6
ServerAliveInterval 7
1
Much obliged Martin.
– Pritzl
7 hours ago
add a comment |
For each directive, the first relevant occurrence in the ssh_config
is used.
Quoting man page for ssh_config
:
For each parameter, the first obtained value will be used. The configuration files contain sections separated by
Host
specifications, and that section is only applied for hosts that match one of the patterns given in the specification. ...
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
So with the configuration file below:
- For all hosts,
ServerAliveInterval 1
is always used,4
and7
are never used, not even forwork
.
ConnectTimeout
is2
forwork
, for other hosts it's3
.- For all hosts, the
ServerAliveCountMax
is5
, thework
-specific value6
is never used, not even forwork
.
ServerAliveInterval 1
Host work
ConnectTimeout 2
Host *
ConnectTimeout 3
ServerAliveInterval 4
ServerAliveCountMax 5
Host work
ServerAliveCountMax 6
ServerAliveInterval 7
1
Much obliged Martin.
– Pritzl
7 hours ago
add a comment |
For each directive, the first relevant occurrence in the ssh_config
is used.
Quoting man page for ssh_config
:
For each parameter, the first obtained value will be used. The configuration files contain sections separated by
Host
specifications, and that section is only applied for hosts that match one of the patterns given in the specification. ...
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
So with the configuration file below:
- For all hosts,
ServerAliveInterval 1
is always used,4
and7
are never used, not even forwork
.
ConnectTimeout
is2
forwork
, for other hosts it's3
.- For all hosts, the
ServerAliveCountMax
is5
, thework
-specific value6
is never used, not even forwork
.
ServerAliveInterval 1
Host work
ConnectTimeout 2
Host *
ConnectTimeout 3
ServerAliveInterval 4
ServerAliveCountMax 5
Host work
ServerAliveCountMax 6
ServerAliveInterval 7
For each directive, the first relevant occurrence in the ssh_config
is used.
Quoting man page for ssh_config
:
For each parameter, the first obtained value will be used. The configuration files contain sections separated by
Host
specifications, and that section is only applied for hosts that match one of the patterns given in the specification. ...
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
So with the configuration file below:
- For all hosts,
ServerAliveInterval 1
is always used,4
and7
are never used, not even forwork
.
ConnectTimeout
is2
forwork
, for other hosts it's3
.- For all hosts, the
ServerAliveCountMax
is5
, thework
-specific value6
is never used, not even forwork
.
ServerAliveInterval 1
Host work
ConnectTimeout 2
Host *
ConnectTimeout 3
ServerAliveInterval 4
ServerAliveCountMax 5
Host work
ServerAliveCountMax 6
ServerAliveInterval 7
edited 6 hours ago
answered 7 hours ago
Martin PrikrylMartin Prikryl
12.2k4 gold badges37 silver badges85 bronze badges
12.2k4 gold badges37 silver badges85 bronze badges
1
Much obliged Martin.
– Pritzl
7 hours ago
add a comment |
1
Much obliged Martin.
– Pritzl
7 hours ago
1
1
Much obliged Martin.
– Pritzl
7 hours ago
Much obliged Martin.
– Pritzl
7 hours ago
add a comment |
Pritzl is a new contributor. Be nice, and check out our Code of Conduct.
Pritzl is a new contributor. Be nice, and check out our Code of Conduct.
Pritzl is a new contributor. Be nice, and check out our Code of Conduct.
Pritzl is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1456255%2fare-host-configurations-in-the-ssh-config-merged%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