mirror of
https://github.com/upa/mscp.git
synced 2026-02-14 17:24:42 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user