Configuring .ssh/config to forward host aliases to a remote host?
Clash 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.
ssh alias
add a comment |Â
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.
ssh alias
add a comment |Â
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.
ssh alias
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
ssh alias
edited Sep 13 at 18:21
Goro
5,47052460
5,47052460
asked Sep 13 at 16:55
MrDuk
5351516
5351516
add a comment |Â
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
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
add a comment |Â
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
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
add a comment |Â
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
add a comment |Â
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
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
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
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
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