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

Option to prompt for SSH password when using sshpass -e #247

Open
rubenhorn opened this issue Nov 10, 2023 · 4 comments
Open

Option to prompt for SSH password when using sshpass -e #247

rubenhorn opened this issue Nov 10, 2023 · 4 comments

Comments

@rubenhorn
Copy link
Contributor

Context

Recently, a feature was added for using the SSH password set in the environment #246.
However, it may also be convenient to prompt the user to provide this variable if it is not set.

Proposed solution

  1. Add the option prompt_sshpass: true for machine_user.yml1
  2. Require that manual_sshpass: true if manual_sshpass: true
  3. Upon starting the fabsim, if env.manual_sshpass and not env.env_sshpass and env.sshpass is empty, prompt the user for his SSH password and set the environment variable SSHPASS and env.env_sshpass accordingly (False if empty password submitted).
  4. Connect to the machine

Motivation

Why may this be necessary?
When working with a remote system, where used to distribute user jobs to different clusters of which only some may require SSH password authentication on top of a public key, the former should probably not be stored on this system. While with #246 users can now set the password in the environment prior to launching the job, this requires that they know the selected machine requires a password. It is thus much more convenient (and does not compromise security) to prompt the user to enter the password when starting a task on a machine which has been set up with this requirement.

Footnotes

  1. Perhaps default to true if env.manual_sshpass which would require making sshpass optional and updating the corresponding comment in machines.yml

@rubenhorn
Copy link
Contributor Author

I'll see if I can make some time to work on this one.

@djgroen
Copy link
Owner

djgroen commented Nov 10, 2023

Hi Ruben. Very interesting development on this! Are you working in an environment where multiplexing is not an option?

@rubenhorn
Copy link
Contributor Author

As far as I understand SSH multiplexing, this would be useful if I'm in an environment where

  • A) Users at least occasionally log in manually at the target machine
  • B) Any user sends tasks to the target machine regularly (within ControlPersist)

This may not be the case in my scenario, where the machine may be used very infrequently and its authentication requirements vary from that of other machines.

@rubenhorn
Copy link
Contributor Author

Also applies to #260.

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

No branches or pull requests

2 participants