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;








2















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?










share|improve this question









New contributor



Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    2















    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?










    share|improve this question









    New contributor



    Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      2












      2








      2


      1






      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?










      share|improve this question









      New contributor



      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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






      share|improve this question









      New contributor



      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 8 hours ago









      Martin Prikryl

      12.2k4 gold badges37 silver badges85 bronze badges




      12.2k4 gold badges37 silver badges85 bronze badges






      New contributor



      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      PritzlPritzl

      132 bronze badges




      132 bronze badges




      New contributor



      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Pritzl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          4














          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 and 7 are never used, not even for work.


          • ConnectTimeout is 2 for work, for other hosts it's 3.

          • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.

          ServerAliveInterval 1

          Host work
          ConnectTimeout 2

          Host *
          ConnectTimeout 3
          ServerAliveInterval 4
          ServerAliveCountMax 5

          Host work
          ServerAliveCountMax 6
          ServerAliveInterval 7





          share|improve this answer




















          • 1





            Much obliged Martin.

            – Pritzl
            8 hours ago













          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.









          draft saved

          draft discarded


















          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









          4














          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 and 7 are never used, not even for work.


          • ConnectTimeout is 2 for work, for other hosts it's 3.

          • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.

          ServerAliveInterval 1

          Host work
          ConnectTimeout 2

          Host *
          ConnectTimeout 3
          ServerAliveInterval 4
          ServerAliveCountMax 5

          Host work
          ServerAliveCountMax 6
          ServerAliveInterval 7





          share|improve this answer




















          • 1





            Much obliged Martin.

            – Pritzl
            8 hours ago















          4














          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 and 7 are never used, not even for work.


          • ConnectTimeout is 2 for work, for other hosts it's 3.

          • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.

          ServerAliveInterval 1

          Host work
          ConnectTimeout 2

          Host *
          ConnectTimeout 3
          ServerAliveInterval 4
          ServerAliveCountMax 5

          Host work
          ServerAliveCountMax 6
          ServerAliveInterval 7





          share|improve this answer




















          • 1





            Much obliged Martin.

            – Pritzl
            8 hours ago













          4












          4








          4







          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 and 7 are never used, not even for work.


          • ConnectTimeout is 2 for work, for other hosts it's 3.

          • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.

          ServerAliveInterval 1

          Host work
          ConnectTimeout 2

          Host *
          ConnectTimeout 3
          ServerAliveInterval 4
          ServerAliveCountMax 5

          Host work
          ServerAliveCountMax 6
          ServerAliveInterval 7





          share|improve this answer















          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 and 7 are never used, not even for work.


          • ConnectTimeout is 2 for work, for other hosts it's 3.

          • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.

          ServerAliveInterval 1

          Host work
          ConnectTimeout 2

          Host *
          ConnectTimeout 3
          ServerAliveInterval 4
          ServerAliveCountMax 5

          Host work
          ServerAliveCountMax 6
          ServerAliveInterval 7






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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












          • 1





            Much obliged Martin.

            – Pritzl
            8 hours ago







          1




          1





          Much obliged Martin.

          – Pritzl
          8 hours ago





          Much obliged Martin.

          – Pritzl
          8 hours ago










          Pritzl is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          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.




          draft saved


          draft discarded














          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





















































          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

          ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

          Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

          19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу