mirror of
https://github.com/ovh/the-bastion.git
synced 2026-05-09 08:25:27 +02:00
[GH-ISSUE #574] If I already have my own ssh keypair, how do I use them instead of automatically generated keypair? #150
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#150
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 @gobiursus on GitHub (Aug 25, 2025).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/574
Hi,
Before I even heard of the-bastion, I was already using a SSH keypair. How do I use my existing SSH keypair instead of using the automatically generated SSH keys?
Thank you
@speed47 commented on GitHub (Sep 10, 2025):
This is not officially supported, because the idea is that if/whether a private key leaves the bastion, they should be considered as compromised. In other words, if importing preexisting private keys was possible, if later they are found out to be compromised, there would be no way to know whether this was before they were imported on the bastion, or due to a bug/vulnerability in it.
Now, if you still want to do it, it's possible, as long as you are okay with manually pushing them on the bastion server. The easiest way to do it is to simply replace a preexisting private/public keypair by the keypair you'd like to import.
There are 2 cases: importing egress keys for a group, or importing keys for a personal account.
For a group, keys are located there:
So, for a group named "example", having an ed25519 keypair, this would be:
If you replace the contents of these files with your own preexisting keypair, this will work. take care not to change the ownerships of the files, though.
For an account, keys are located there:
You may also replace the contents of these files.
To check that the changes you made are valid, you can use
groupInfoandaccountListEgressKeys.