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

Use SSH in the shell to support user ~/.ssh/config #61

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjcarstens
Copy link
Member

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 use MIX_TARGET=rpi0 mix upload which finds the firmware and uploads. That is not possible with erlexec 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 host erlexec 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 text
  • nbtty This essentially just added a pseudo shell on top of SSH, but would still require execution methods of Port, extty, or erlexec. It could not just be run as a System.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?

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
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 this pull request may close these issues.

1 participant