mirror of
https://github.com/ovh/the-bastion.git
synced 2026-05-09 08:25:27 +02:00
[GH-ISSUE #152] Add automaticaly the port number when connecting to a host with a different ssh port #31
Labels
No labels
answered
bug
documentation
enhancement
enhancement
feature
feature
kept-open-for-info
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/the-bastion#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @deepbluemussel on GitHub (Feb 23, 2021).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/152
When connecting to a host with a different standard port, you have to specify the port number.
It would be more convenient if the port is added to the ssh command depending on the server you want to connect to.
@speed47 commented on GitHub (Feb 26, 2021):
Currently the way it works, is the user asks to connect somewhere, the bastion checks whether this is allowed or not, and takes decision based upon this. This behavior has to stay by default, because that's also how SSH works (if you don't specify a port, it always defaults to 22). However we could imagine a cmdline switch that, in the absence of an explicitly specified port, would try to find a matching allowed server with a non-22 port. This cmdline switch could be added, by the users, directly in their bastion alias if they'd like to use this behavior all the time. I didn't check yet whether this would be easy to implement or not, but would something like that work for you?
@deepbluemussel commented on GitHub (Feb 28, 2021):
This is exactly the kind of solution I had in mind. At each ssh connection attempt, the command would list the available connections and automatically add the associated port.
Right now I'm using aliases to add the non-standard port and only a couple of instances uses port 22 so that's not a blocking issue, just to add more convenience.