-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Provide an easy option to setup OpenSSH Config. #3734
Comments
We should also support the On a slightly different note, I also have a script I wrote (https://gist.github.com/webvictim/6a306267cad85c024d93641985acfa0b) that goes into Also, I've been meaning to write a guide for a while on how to use |
Similar to #4989 |
Coming from the Okta ASA / ScaleFT world they have something similar to this that works like so:
|
tentatively adding this to 7.0 |
After discussing with @russjones I've put together a prototype implementation in a branch implementing what I believe may be the best path forward: eaaa19c. (It is pretty rough at the moment, with a number of unsupported edge cases and outstanding TODOs.) As already discussed, there are a few different paths to implement this. The
Of note, this:
Unfortunately it still has some drawbacks:
To work around these drawbacks, I'd like to introduce an extra helper subcommand to In the prototype branch, users can generate an SSH config snippet using If this looks like a sane direction, there's a number of further improvements that could be made:
|
Question: @timothyb89 how much the slowdown the match exec really is? I think it's so interesting and simple, compared to additional subcommands and patterns. |
Note on CLI/UX:
|
Random thought (feel free to ignore) What if we use the I ran: gcloud compute config-ssh
Updating project ssh metadata...⠼
Updating project ssh metadata...done.
You should now be able to use ssh/scp with your instances.
For example, try running:
$ ssh gke-houston-default-pool-dc969126-nr65.us-central1-a.kubeadm-167321 ~/.ssh/config
# Google Compute Engine Section
#
# The following has been auto-generated by "gcloud compute config-ssh"
# to make accessing your Google Compute Engine virtual machines easier.
#
# To remove this blob, run:
#
# gcloud compute config-ssh --remove
#
# You can also manually remove this blob by deleting everything from
# here until the comment that contains the string "End of Google Compute
# Engine Section".
#
# You should not hand-edit this section, unless you are deleting it.
#
Host gke-houston-default-pool-dc969126-nr65.us-central1-a.kubeadm-167321
HostName 1.2.3.4
IdentityFile /home/sasha/.ssh/google_compute_engine
UserKnownHostsFile=/home/sasha/.ssh/google_compute_known_hosts
HostKeyAlias=compute.7416332556765778597
IdentitiesOnly=yes
CheckHostIP=no
# End of Google Compute Engine Section |
I think having subcommands |
I’d like to look into this more and try to quantify the impact, the concern is that the check would be executed for all
I’m very much open to revising the command naming, my placeholders are more than a little clunky. I mainly wanted to avoid creating any conflicts for the proof of concept.
I definitely like parts of this UX, I think we could avoid mutating the user’s own ssh config by writing our own config and including it. With |
Cataloging a couple more observations from today:
I've updated my branch to add a third subcommand to test if a hostname is a Teleport node (used to produce the above measurement). The following ssh client config now works as an alternative to what's generated by
(as before, these are placeholder subcommands/flags) I'm a bit wary of the added runtime cost, especially given it affects all Measurement notes: I ran the following using different configurations: for i in {0..20}; do gtime -f '%e' ssh node000.foo.example.com exit; done ...and averaged the results:
Similarly, connecting to a non-Teleport host (just localhost):
|
After speaking with @russjones again, our proposal is to start with a simpler solution and iterate on it over time, particularly as @smallinsky's work on SNI routing progresses. We'd like to start with a single new subcommand,
... with a small addendum to use We'd prefer to hold off on introducing any additional subcommands; a |
@timothyb89 sounds good, but a quick nitpick on the new command naming, I think |
@timothyb89 chatted to @russjones - it seems like |
As for removal, my plan was to leave the editing the file entirely up to the user - we'll output the config snippet to stdout which the user is free to insert into their |
@klizhentas Hmm, that might lead to a bit confusing UX IMHO. Right now we've been designing all k8s, application and database access related commands to be in their respective subcommand "namespaces" ( With the proposed change it would be kind of weird if the users will need to run I think the way we've been approaching it so far, is that since SSH is our oldest protocol, commands related to it don't really have any "subcommand" namespace, while new access types we're adding (kube/app/db) are grouped under respective subcommands. So for example what we have now is: $ tsh login # retrieve cluster (effectively, SSH) credentials
$ tsh (kube/app/db) login # retrieve k8s/app/db credentials
$ tsh ls # shows SSH servers
$ tsh (kube/app/db) ls # shows K8s/app/db servers By this analogy, just leaving |
@klizhentas Any thoughts on @r0mant's suggestion? I'm happy to implement either option. |
I've just posted a pull request with an initial implementation here: #7437 |
@timothyb89 let's go with @r0mant suggestion cc @russjones |
Feature Request
Using Teleport with OpenSSH still requires a diving into the docs and knowing a lot about Teleport, if they don't want to use an SSH agent.
The output would be repopulated with the tsh profile.
$ tsh config
Motivation
This was an idea from @webvictim and it'll help reduce support load and make Windows setup much easier.
Who's it for?
OSS User, Pro, Enterprise
The text was updated successfully, but these errors were encountered: