Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not re-establish ssh connection while copying each and every secret #102

Open
flokli opened this issue Jan 20, 2020 · 4 comments
Open

Comments

@flokli
Copy link

flokli commented Jan 20, 2020

It might make sense to have morph use the go ssh client implementation instead of shelling out to the ssh binary.

This should be a way to address morph failing to deploy without ssh in $PATH (also see NixOS/nixpkgs#78106)

On top of that, it might make deploying secrets faster, because we can better reuse an existing session instead of creating a new one each and every time.

cc @johanot

@johanot
Copy link
Contributor

johanot commented Jan 20, 2020

@flokli Thanks for this. We actually thought about that when writing the first versions of morph. One major argument against this is to align with how nix copy handles remote ssh stores: https://github.com/NixOS/nix/blob/master/src/libstore/ssh.cc#L103 . Since nix copy is also invoked directly by morph, we might risk having two diverging ssh-environments present at a single morph invocation. Besides that, there are plenty of positive arguments for this suggestion :).

@flokli
Copy link
Author

flokli commented Jan 21, 2020

This is somewhat scary - how do you envision this to break?

@johanot
Copy link
Contributor

johanot commented Jan 26, 2020

see also @andrew-d 's comment here: NixOS/nixpkgs#78107 (comment)

@flokli
Copy link
Author

flokli commented Jan 31, 2020

That's right - didn't think about smartcards and such.

Another idea - can we

A) set ControlMasterand friends (to reuse a master connection when invoking ssh commands)
B) open a ssh connection once and copy over all secrets inside the same connection?

@flokli flokli changed the title Make more use of "golang.org/x/crypto/ssh" instead of shelling out to ssh Do not re-establish ssh connection while copying each and every secret Jan 31, 2020
gaykitty added a commit to gaykitty/morph that referenced this issue May 25, 2023
This variable allows users to specify other custom arguments to be
used with ssh and scp. This allows users to take advantage of more
advanced ssh features like ControlPath, which could be used to fix
\DBCDK#102 among other things.
gaykitty added a commit to gaykitty/morph that referenced this issue May 25, 2023
This variable allows users to specify other custom arguments to be
used with ssh and scp. This allows users to take advantage of more
advanced ssh features like ControlPath, which could be used to fix DBCDK#102
among other things.
gaykitty added a commit to gaykitty/morph that referenced this issue Mar 10, 2024
This variable allows users to specify other custom arguments to be
used with ssh and scp. This allows users to take advantage of more
advanced ssh features like ControlPath, which could be used to fix DBCDK#102
among other things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants