diff options
author | Ryo Nakamura <upa@haeena.net> | 2024-02-06 10:35:38 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2024-02-06 10:35:38 +0900 |
commit | ff45d9d71b85a618aed6d3d5e5056bada6ff81f9 (patch) | |
tree | 8f5989f7f30f8e8a9320128617fa63e22115d65a /src/main.c | |
parent | 9908fb309d9388481769e1a558a1f8dc47c4dabf (diff) |
add two env vars to pass password/keyphrase (#9)
MSCP_SSH_AUTH_PASSWORD passes a password, and MSCP_SSH_AUTH_PASSPHRASE
passes a passphrase for publickey auth. They enable avoiding interactive
password input. Test cases are also added.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -344,6 +344,10 @@ int main(int argc, char **argv) } } + s.password = getenv(ENV_SSH_AUTH_PASSWORD); + s.passphrase = getenv(ENV_SSH_AUTH_PASSPHRASE); + + if (argc - optind < 2) { /* mscp needs at lease 2 (src and target) argument */ usage(false); |