-
Notifications
You must be signed in to change notification settings - Fork 2
Use ssh keys instead of password based auth #3
Comments
Hi! Could I work on this? |
Yeah sure! For choosing which keys to use, I guess you could create a separate key file for heiko specifically or you could use the system's keys. Anything is fine. |
The way it was done in the the previous heiko was this: pesos/heiko@4874dce Yeah xD, the ssh package handled parsing the ssh config by default if the password wasn't given. It appears that the Golang ssh package does not do this There is a Let us know if you find any better package for this. |
I was thinking it would look for a default set of keys, unless a specific key is specified through the config file or maybe as a command line arg. If any issue is encountered, it could return immediately. Also, just to confirm, this should happen right before the spawning of routines in |
I did see this, I'll do a little bit of digging before I get started on this then. |
Yes, this is correct. Just to confirm, by config file you mean the SSH config file, right? (
I was thinking it would be in |
Yep! |
@Samyak2 @psiayn, when using SSH keys, shouldn't the keys first be exported to the node, following which connections can be made? Normally what I've come across is the key being copied by using something like Are we looking for something similar where the user types in a password and after authentication, keys are transferred and we |
The way it was done in the previous implementation was like this:
The same can be done here for an initial implementation.
This is a good idea and would make the process smoother. This can be done in
You can go ahead with this! We will need this anyway, even if keys are transferred. Once we iron out the above details we can start implementing it. Any ideas or draft PRs are ofcourse very welcome 😄, even if the details aren't complete. |
I was thinking we could look at the heiko config for that, if a key path is provided, use that, else resort to a default.
As the user specifies in the config right?
If the auth isn't working, we won't be able to transfer keys even if we want to right? Then we can just return with an error or log that the node is unreachable.
I don't see why this is necessary, we know which keys to use from the heiko config file, we can straight away attempt to transfer those and attempt to establish connections right? We can stick to the default ssh configs too. EDIT: I'll get started on the key read and transfer, I'll send a draft PR when I've covered some ground. |
That makes sense. If the key path isn't provided do we generate a new key just for heiko?
I meant when it's not specified in the SSH config, we only generate the keys then (if the key file is provided in the config, we don't need to generate our own)
Yes that makes sense. What I meant here is that we shouldn't try to override nodes that are already configured by the user. On a second thought, this is taken care of by the above solution (generate key only when it isn't provided in the config)
Here is what I was thinking it would look like:
The best solution I can see is having just one heiko key that is shared by all heiko daemons and nodes (even if it's a different config). These are my personal preferences (and biases xD) for an ideal solution:
What do you think? |
Copying of keys ( if not done already ) should probably be done in the init phase.
The text was updated successfully, but these errors were encountered: