diff --git a/cmdline.c b/cmdline.c index f288ed62..d2a81592 100644 --- a/cmdline.c +++ b/cmdline.c @@ -403,7 +403,18 @@ int cmdline_process_param(const char *p, char *value, SAVEABLE(0); conf_set_int(conf, CONF_tryagent, FALSE); } - + if (!strcmp(p, "-share")) { + RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(0); + conf_set_int(conf, CONF_ssh_connection_sharing, TRUE); + } + if (!strcmp(p, "-noshare")) { + RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(0); + conf_set_int(conf, CONF_ssh_connection_sharing, FALSE); + } if (!strcmp(p, "-A")) { RETURN(1); UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK); diff --git a/doc/man-pl.but b/doc/man-pl.but index 9f411871..58ca7a28 100644 --- a/doc/man-pl.but +++ b/doc/man-pl.but @@ -182,6 +182,15 @@ which of the agent's keys to use. } \dd Allow use of an authentication agent. (This option is only necessary to override a setting in a saved session.) +\dt \cw{\-noshare} + +\dd Don't test and try to share an existing connection, always make +a new connection. + +\dt \cw{\-share} + +\dd Test and try to share an existing connection. + \dt \cw{\-hostkey} \e{key} \dd Specify an acceptable host public key. This option may be specified diff --git a/doc/plink.but b/doc/plink.but index 459ceadf..74da18a1 100644 --- a/doc/plink.but +++ b/doc/plink.but @@ -75,6 +75,8 @@ use Plink: \c -i key private key file for user authentication \c -noagent disable use of Pageant \c -agent enable use of Pageant +\c -noshare disable use of connection sharing +\c -share enable use of connection sharing \c -hostkey aa:bb:cc:... \c manually specify a host key (may be repeated) \c -m file read remote command(s) from file @@ -237,6 +239,28 @@ line. (This option is only meaningful with the SSH-2 protocol.) +\S2{plink-option-share} \I{-share-plink}\c{-share}: +Test and try to share an existing connection. + +This option tris to detect if an existing connection can be shared +(See \k{config-ssh-sharing} for more information about SSH connection +sharing.) and reuses that connection. + +A Plink invocation of the form: + +\c plink -share +\e iiiiiiiii + +will test whether there is currently a viable \q{upstream} for the +session in question, which can be specified using any syntax you'd +normally use with Plink to make an actual connection (a host/port +number, a bare saved session name, \c{-load}, etc). If no \q{upstream} +viable session is found and \c{-share} is specified, this connection +will be become the \q{upstream} connection for subsequent connection +sharing tries. + +(This option is only meaningful with the SSH-2 protocol.) + \S2{plink-option-shareexists} \I{-shareexists-plink}\c{-shareexists}: test for connection-sharing upstream diff --git a/unix/uxplink.c b/unix/uxplink.c index e891d66a..2a1926ef 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -579,6 +579,8 @@ static void usage(void) printf(" -i key private key file for user authentication\n"); printf(" -noagent disable use of Pageant\n"); printf(" -agent enable use of Pageant\n"); + printf(" -noshare disable use of connection sharing\n"); + printf(" -share enable use of connection sharing\n"); printf(" -hostkey aa:bb:cc:...\n"); printf(" manually specify a host key (may be repeated)\n"); printf(" -m file read remote command(s) from file\n"); diff --git a/windows/winplink.c b/windows/winplink.c index ea417501..84e47d6e 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -207,6 +207,8 @@ static void usage(void) printf(" -i key private key file for user authentication\n"); printf(" -noagent disable use of Pageant\n"); printf(" -agent enable use of Pageant\n"); + printf(" -noshare disable use of connection sharing\n"); + printf(" -share enable use of connection sharing\n"); printf(" -hostkey aa:bb:cc:...\n"); printf(" manually specify a host key (may be repeated)\n"); printf(" -m file read remote command(s) from file\n");