[GH-ISSUE #395] Take global ssh_config file into account and autocomplete host names #108

Open
opened 2026-05-07 00:19:03 +02:00 by BreizhHardware · 2 comments

Originally created by @pielonet on GitHub (May 12, 2023).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/395

Hi,

When creating a server for egress you presently do not specify a port, nor a user, nor any specific SSH options for this connection.

Dealing with specific hosts configurations is where ssh_config file is good at. It is aimed at it. It particularly allows to create aliases for hosts so that users do not have to remember servers FQDN to connect to.

Here is an example ssh_config entry that we would like The Bastion to take into account 👍🏽

Host myhostalias
  User myuser
  Port xxxx
  Hostname myserver.example.com

Or even better with wildcards :

Host myhostalias-w*
  User myuser
  Port xxxx
  Hostname %h.example.com

What more it would be useful to autocomplete host names (based on host aliases) like the ssh command usually does when trying to ssh to a server. This way users wouldn't have to remember specific domains. In case you address thousands of servers (like we do) it would just make it possible to use The Bastion.

The fact that The Bastion presently does not take this sort of specific configuration files into account is what prevents us from implementing this solution.

This issue is more or less linked to this one #152 opened two years ago.

Originally created by @pielonet on GitHub (May 12, 2023). Original GitHub issue: https://github.com/ovh/the-bastion/issues/395 Hi, When creating a server for egress you presently do not specify a port, nor a user, nor any specific SSH options for this connection. Dealing with specific hosts configurations is where [ssh_config](https://linuxize.com/post/using-the-ssh-config-file/) file is good at. It is aimed at it. It particularly allows to create aliases for hosts so that users do not have to remember servers FQDN to connect to. Here is an example `ssh_config` entry that we would like The Bastion to take into account 👍🏽 ``` Host myhostalias User myuser Port xxxx Hostname myserver.example.com ``` Or even better with wildcards : ``` Host myhostalias-w* User myuser Port xxxx Hostname %h.example.com ``` What more it would be useful to **autocomplete** host names (based on host aliases) like the `ssh` command usually does when trying to ssh to a server. This way users wouldn't have to remember specific domains. In case you address thousands of servers (like we do) it would just make it possible to use The Bastion. The fact that The Bastion presently does not take this sort of specific configuration files into account is what prevents us from implementing this solution. This issue is more or less linked to this one #152 opened two years ago.
Author
Owner

@maxatome commented on GitHub (May 25, 2023):

Hi, doesn't #384 fulfill your needs?

<!-- gh-comment-id:1562788468 --> @maxatome commented on GitHub (May 25, 2023): Hi, doesn't [#384](https://github.com/ovh/the-bastion/issues/384#issuecomment-1498786380) fulfill your needs?
Author
Owner

@pielonet commented on GitHub (Jun 5, 2023):

Hi,

Yes this contrib #384 fixed my issue. Thanks.

I wrote following configuration style:

Host myhostalias
	Hostname bastion.example.com
	RequestTTY yes
	RemoteCommand -p xxxx myuser@remotehost.example.com
	User myuser
	Port  xxxx

It can be closed.

Kind regards,
Thierry

<!-- gh-comment-id:1576191521 --> @pielonet commented on GitHub (Jun 5, 2023): Hi, Yes this contrib #384 fixed my issue. Thanks. I wrote following configuration style: ``` Host myhostalias Hostname bastion.example.com RequestTTY yes RemoteCommand -p xxxx myuser@remotehost.example.com User myuser Port xxxx ``` It can be closed. Kind regards, Thierry
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#108
No description provided.