Use SSH in the shell to support user ~/.ssh/config
#61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This also forwards STDIN back to the mix task so that if SSH needs a passcode for the certificate or authentication, then the user can input it.
This is working, but it seems like using the port this way comes at a cost of potential zombie processes (i.e. when a user ctrl-c to try and stop it, things may still carry on...but this is technically existing behavior).
I tried several methods and this seemed to be the best so far. Here are some of my attempts:
:erlexec
worked well but it would take more trickery to avoid displaying the user password input. Also, it does not compile with the Nerves toolchains. This is problematic because the common behavior is to useMIX_TARGET=rpi0 mix upload
which finds the firmware and uploads. That is not possible witherlexec
since even if it could compile, it would be unusable to the host to upload. Maybe there is a way to force mix to use the hosterlexec
during the task process?:extty
could get a shell initially started, but would stop there. I was never able to successfully send further commands after starting the shell. Also, it would have the same problem of needing trickery to not display user password in clear textnbtty
This essentially just added a pseudo shell on top of SSH, but would still require execution methods ofPort
,extty
, orerlexec
. It could not just be run as aSystem.cmd
because it requires a terminal:ssh_connection
In IEx, this could work fairly well with username/password, but within a task it behaved differently and could not get the password passed to the SSH process. Also, I was unable to get it to prompt for a password protected certificate. It seems to want that password specified before starting the SSH process?