summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-08-04 13:31:10 +0900
committerRyo Nakamura <upa@haeena.net>2023-08-04 13:31:10 +0900
commit518aa42208969566aa26cf82a40d1ecb6358684a (patch)
tree676bd0795f25966719d1d242ed8c9a18e57597b8 /src/main.c
parent3b26c7c7191c44ddd8840a803b603cd2f60ac059 (diff)
add -F ssh_config option
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 7c8efb6..7035215 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,7 +26,7 @@ void usage(bool print_help) {
"\n"
"Usage: mscp [vqDHdNh] [-n nr_conns] [-m coremask] [-u max_startups]\n"
" [-s min_chunk_sz] [-S max_chunk_sz] [-a nr_ahead] [-b buf_sz]\n"
- " [-l login_name] [-p port] [-i identity_file]\n"
+ " [-l login_name] [-p port] [-F ssh_config] [-i identity_file]\n"
" [-c cipher_spec] [-M hmac_spec] [-C compress] source ... target\n"
"\n");
@@ -51,6 +51,8 @@ void usage(bool print_help) {
"\n"
" -l LOGIN_NAME login name\n"
" -p PORT port number\n"
+ " -F CONFIG path to user ssh config (default ~/.ssh/config)\n"
+ " if set to 'none', no config files will be read.\n"
" -i IDENTITY identity file for public key authentication\n"
" -c CIPHER cipher spec\n"
" -M HMAC hmac spec\n"
@@ -207,7 +209,7 @@ int main(int argc, char **argv)
memset(&o, 0, sizeof(o));
o.severity = MSCP_SEVERITY_WARN;
- while ((ch = getopt(argc, argv, "n:m:u:s:S:a:b:vqDrl:p:i:c:M:C:HdNh")) != -1) {
+ while ((ch = getopt(argc, argv, "n:m:u:s:S:a:b:vqDrl:p:i:F:c:M:C:HdNh")) != -1) {
switch (ch) {
case 'n':
o.nr_threads = atoi(optarg);
@@ -261,6 +263,9 @@ int main(int argc, char **argv)
}
strncpy(s.port, optarg, MSCP_SSH_MAX_PORT_STR);
break;
+ case 'F':
+ strncpy(s.config, optarg, PATH_MAX - 1);
+ break;
case 'i':
if (strlen(optarg) > MSCP_SSH_MAX_IDENTITY_PATH - 1) {
fprintf(stderr, "long identity path: %s\n", optarg);