Configuring .ssh/config to forward host aliases to a remote host?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












We use jump hosts to access our hardware. These hosts are short-lived (less than a day), and are different every time they're generated. I would like to be able to configure my local .ssh/config file to have the aliases to my real hardware, and be able to forward those aliases to my jump host.



I had tried the following command but it failed:



ssh <jumphost> -t bash -ci ssh <hostalias>


Are there any options that I can try?



jumphost don't mind hand typing, because it is changes so frequently. I just would like a way to automate the process of jumping to that host, and then to the real hardware from there.










share|improve this question



























    up vote
    0
    down vote

    favorite












    We use jump hosts to access our hardware. These hosts are short-lived (less than a day), and are different every time they're generated. I would like to be able to configure my local .ssh/config file to have the aliases to my real hardware, and be able to forward those aliases to my jump host.



    I had tried the following command but it failed:



    ssh <jumphost> -t bash -ci ssh <hostalias>


    Are there any options that I can try?



    jumphost don't mind hand typing, because it is changes so frequently. I just would like a way to automate the process of jumping to that host, and then to the real hardware from there.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      We use jump hosts to access our hardware. These hosts are short-lived (less than a day), and are different every time they're generated. I would like to be able to configure my local .ssh/config file to have the aliases to my real hardware, and be able to forward those aliases to my jump host.



      I had tried the following command but it failed:



      ssh <jumphost> -t bash -ci ssh <hostalias>


      Are there any options that I can try?



      jumphost don't mind hand typing, because it is changes so frequently. I just would like a way to automate the process of jumping to that host, and then to the real hardware from there.










      share|improve this question















      We use jump hosts to access our hardware. These hosts are short-lived (less than a day), and are different every time they're generated. I would like to be able to configure my local .ssh/config file to have the aliases to my real hardware, and be able to forward those aliases to my jump host.



      I had tried the following command but it failed:



      ssh <jumphost> -t bash -ci ssh <hostalias>


      Are there any options that I can try?



      jumphost don't mind hand typing, because it is changes so frequently. I just would like a way to automate the process of jumping to that host, and then to the real hardware from there.







      ssh alias






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 13 at 18:21









      Goro

      5,47052460




      5,47052460










      asked Sep 13 at 16:55









      MrDuk

      5351516




      5351516




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          In your .ssh/config:



          Host farsidehost
          HostName acutalremotehostname.example.com
          ProxyJump bastionhost.example.com


          You can then execute ssh farsidehost.



          If as your updates tell, the name of the jumphost changes frequently, you can instead specify it on the commandline:



          $ ssh -J jumphostoftheday.example.com actualremotehostname.example.com


          If there is some way to procedurally find the name of the jumphost, this can be automated:



          $ ssh -J $( determine_jump_host ) actualremotehostname.example.com





          share|improve this answer






















          • Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:07










          • In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
            – DopeGhoti
            Sep 13 at 17:09

















          up vote
          1
          down vote













          Use local variable names for the real hardware, and have your local ssh command line expand those variables.



          proddb=dc1r12u10.internal.dns
          jumper=vm20180913.internal.dns
          ssh $jumper -t bash -ci ssh $proddb





          share|improve this answer




















          • Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:08










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f468838%2fconfiguring-ssh-config-to-forward-host-aliases-to-a-remote-host%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          In your .ssh/config:



          Host farsidehost
          HostName acutalremotehostname.example.com
          ProxyJump bastionhost.example.com


          You can then execute ssh farsidehost.



          If as your updates tell, the name of the jumphost changes frequently, you can instead specify it on the commandline:



          $ ssh -J jumphostoftheday.example.com actualremotehostname.example.com


          If there is some way to procedurally find the name of the jumphost, this can be automated:



          $ ssh -J $( determine_jump_host ) actualremotehostname.example.com





          share|improve this answer






















          • Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:07










          • In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
            – DopeGhoti
            Sep 13 at 17:09














          up vote
          2
          down vote













          In your .ssh/config:



          Host farsidehost
          HostName acutalremotehostname.example.com
          ProxyJump bastionhost.example.com


          You can then execute ssh farsidehost.



          If as your updates tell, the name of the jumphost changes frequently, you can instead specify it on the commandline:



          $ ssh -J jumphostoftheday.example.com actualremotehostname.example.com


          If there is some way to procedurally find the name of the jumphost, this can be automated:



          $ ssh -J $( determine_jump_host ) actualremotehostname.example.com





          share|improve this answer






















          • Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:07










          • In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
            – DopeGhoti
            Sep 13 at 17:09












          up vote
          2
          down vote










          up vote
          2
          down vote









          In your .ssh/config:



          Host farsidehost
          HostName acutalremotehostname.example.com
          ProxyJump bastionhost.example.com


          You can then execute ssh farsidehost.



          If as your updates tell, the name of the jumphost changes frequently, you can instead specify it on the commandline:



          $ ssh -J jumphostoftheday.example.com actualremotehostname.example.com


          If there is some way to procedurally find the name of the jumphost, this can be automated:



          $ ssh -J $( determine_jump_host ) actualremotehostname.example.com





          share|improve this answer














          In your .ssh/config:



          Host farsidehost
          HostName acutalremotehostname.example.com
          ProxyJump bastionhost.example.com


          You can then execute ssh farsidehost.



          If as your updates tell, the name of the jumphost changes frequently, you can instead specify it on the commandline:



          $ ssh -J jumphostoftheday.example.com actualremotehostname.example.com


          If there is some way to procedurally find the name of the jumphost, this can be automated:



          $ ssh -J $( determine_jump_host ) actualremotehostname.example.com






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 13 at 17:11

























          answered Sep 13 at 17:00









          DopeGhoti

          41.3k55180




          41.3k55180











          • Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:07










          • In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
            – DopeGhoti
            Sep 13 at 17:09
















          • Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:07










          • In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
            – DopeGhoti
            Sep 13 at 17:09















          Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
          – MrDuk
          Sep 13 at 17:07




          Hey thanks, I should make it more clear in my question; our jump hosts are different every time (they only live for a few hours at a time).
          – MrDuk
          Sep 13 at 17:07












          In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
          – DopeGhoti
          Sep 13 at 17:09




          In that case you can on the command line specify the jump host: ssh -J jumphost.example.com farsidehost.example.com.
          – DopeGhoti
          Sep 13 at 17:09












          up vote
          1
          down vote













          Use local variable names for the real hardware, and have your local ssh command line expand those variables.



          proddb=dc1r12u10.internal.dns
          jumper=vm20180913.internal.dns
          ssh $jumper -t bash -ci ssh $proddb





          share|improve this answer




















          • Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:08














          up vote
          1
          down vote













          Use local variable names for the real hardware, and have your local ssh command line expand those variables.



          proddb=dc1r12u10.internal.dns
          jumper=vm20180913.internal.dns
          ssh $jumper -t bash -ci ssh $proddb





          share|improve this answer




















          • Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:08












          up vote
          1
          down vote










          up vote
          1
          down vote









          Use local variable names for the real hardware, and have your local ssh command line expand those variables.



          proddb=dc1r12u10.internal.dns
          jumper=vm20180913.internal.dns
          ssh $jumper -t bash -ci ssh $proddb





          share|improve this answer












          Use local variable names for the real hardware, and have your local ssh command line expand those variables.



          proddb=dc1r12u10.internal.dns
          jumper=vm20180913.internal.dns
          ssh $jumper -t bash -ci ssh $proddb






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 13 at 16:59









          Cupcake Protocol

          1463




          1463











          • Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:08
















          • Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
            – MrDuk
            Sep 13 at 17:08















          Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
          – MrDuk
          Sep 13 at 17:08




          Hey thanks, I made it more clear in my question just now, sorry; our jump hosts are different every time (they only live for a few hours at a time).
          – MrDuk
          Sep 13 at 17:08

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468838%2fconfiguring-ssh-config-to-forward-host-aliases-to-a-remote-host%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay