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
Soda water first stored in refrigerator and then outside
How important is it for multiple POVs to run chronologically?
Why do Martians have to wear space helmets?
Will Jimmy fall off his platform?
How do amateur satellites stay consistently in the amateur-sat bands acoss the globe?
Gory anime with pink haired girl escaping an asylum
Wearing special clothes in public while in niddah- isn't this a lack of tznius?
Howto display unicode character u2026 in terminal mode in emacs
Bringing coumarin-containing liquor into the USA
What is the maximum amount of diamond in one Minecraft game?
How did Einstein know the speed of light was constant?
PhD: When to quit and move on?
How would a sea turtle end up on its back?
Groups where no elements commute except for the trivial cases
Can I Ready an attack action to trigger when the target Blinks back to the Material plane?
Initializing variables in an "if" statement
What do I need to see before Spider-Man: Far From Home?
What is this airplane with small wings at different angles seen at Paphos Airport?
Shipped package arrived - didn't order, possible scam?
Do I need transit visa for Dublin?
What is the fundamental difference between catching whales and hunting other animals?
Is this car delivery via Ebay Motors on Craigslist a scam?
How to delete multiple process id of a single process?
I'm feeling like my character doesn't fit the campaign
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