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.
This commit is contained in:
Ryo Nakamura
2024-02-06 10:35:38 +09:00
parent 9908fb309d
commit ff45d9d71b
11 changed files with 172 additions and 20 deletions

View File

@@ -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);