8000 Feature request: Handle multiple password prompts · Issue #1 · drcheap/sshpass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature request: Handle multiple password prompts #1

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

Open
drcheap opened this issue May 16, 2020 · 0 comments
Open

Feature request: Handle multiple password prompts #1

drcheap opened this issue May 16, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@drcheap
Copy link
Owner
drcheap commented May 16, 2020

So I have a use case for sshpass where I need to accomplish a file transfer between two remote systems using SCP. There are many people attempting to do this exact thing, and running into the same issue. Lots of duplicate questions on StackOverflow for example. Of course everyone's "solution" is to just use public key authentication, or some misdirection about how the -p parameter is dangerous, which totally misses the point of why one may be using sshpass in the first place.

I realize I could do this as 2 steps, which would be fine for a single operation, but in my case this is part of a much larger script that does this many times for many files.

An example scenario, doing things fully manual/interactive on the CLI:

user@hostA$ scp hostB:foo hostC:foo
user@hostB's password:
user@hostC's password:
foo 100% 4 6.5KB/s 00:00
user@hostA$ scp hostB:bar hostC:bar
user@hostB's password:
user@hostC's password:
bar 100% 4 6.5KB/s 00:00
user@hostA$

So baseline is (# of SCPs * 2) prompts. I am running this in a script, which is prompting the user for the password (and storing it "safely" in a file with appropriately locked down permissions, and only for the duration of the script). We'll call file that "pw" for this example. Currently sshpass exits after the first prompt, thus I still get the 2nd prompt in each operation:

user@hostA$ myscript.sh
Enter common password:
user@hostC's password:
foo 100% 4 6.5KB/s 00:00
user@hostC's password:
bar 100% 4 6.5KB/s 00:00
user@hostA$

So now I have to type it (# of SCPs + 1) times, an improvement, but still sort of defeats the purpose of why I am using sshpass here.

So the feature I am requesting is one of these...
a) Automagically provide the password as many times as needed (maybe a param to enable this mode?)
b) Provide a parameter to specify the # of times to provide a password before exit in case it cannot be determined by sshpass
c) Allow specifying multiple passwords to provide (e.g. repeated [-f|-d|-p|-e], used up in order given)

Option c might be the most intuitive & flexible way to go about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant
0