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
Does the sensor of a dslr count the number of photons that hits it?
Why do we need a bootloader separate from our application program in microcontrollers?
Is there an upper limit on the number of cards a character can declare to draw from the Deck of Many Things?
How complicated can a finite double complex over a field be?
Chilling juice in copper vessel
How do amateur satellites stay consistently in the amateur-sat bands acoss the globe?
Why do Martians have to wear space helmets?
How to find the version of extensions used on a Joomla website without access to the backend?
Examples of fluid (including air) being used to transmit digital data?
Bringing coumarin-containing liquor into the USA
Multi-user CRUD: Valid, Problem, or Error?
Better random (unique) file name
Will Jimmy fall off his platform?
How do I check that users don't write down their passwords?
Soda water first stored in refrigerator and then outside
I'm feeling like my character doesn't fit the campaign
What is the highest level of accuracy in motion control a Victorian society could achieve?
Computer name naming convention for security
How to delete multiple process id of a single process?
What are some bad ways to subvert tropes?
Why do Klingons use cloaking devices?
As a supervisor, what feedback would you expect from a PhD who quits?
What is the meaning of "prairie-dog" in this sentence?
Is this standard Japanese employment negotiations, or am I missing something?
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 8 hours ago
Martin Prikryl
12.2k4 gold badges37 silver badges85 bronze badges
12.2k4 gold badges37 silver badges85 bronze badges
New contributor
asked 9 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
8 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
8 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
8 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 7 hours ago
answered 8 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
8 hours ago
add a comment |
1
Much obliged Martin.
– Pritzl
8 hours ago
1
1
Much obliged Martin.
– Pritzl
8 hours ago
Much obliged Martin.
– Pritzl
8 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