Closed gotakasan closed 1 year ago
Hello,
Do you mean that, if for example your alias to connect through your bastion is bssh
, you would like to be able to type something like bssh myserver
, were information about myserver
would be given in your ~/.ssh/config
file?
In fact, I wanted to connect with ssh
command (and have word completion for servers given in my ~/.ssh/config
file) through my Bastion.
I want to deploy the solution on my infrastructure and I want it to be the more transparent possible for users.
I manage to do it :
Host BASTION_NAME
Hostname BASTION_IP # OR DNS
User BASTION_USER
IdentityFile PUB_KEY # FOR THE BASTION
Port BASTION_PORT
ForwardAgent yes
Host SERVER
Hostname BASTION_NAME
RequestTTY yes
RemoteCommand SERVER_USER@SERVER
User BASTION_USER
Port BASTION_PORT
So I just have to enter ssh SERVER
and it will connect throught my bastion.
PS : The first block is not really used in second one. It just to connect to my bastion with ssh BASTION_NAME
or to reuse it in Hostname BASTION_NAME
I think I'll add this to the FAQ, thanks.
Hello !
Did you managed to use SSH config file to connect on remote server through Bastion ?
I tried to use ProxyCommand (before seeing on FAQ that I can't :/) but impossible.
Thanks for your help !