diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ssh.1 | 11 | ||||
-rw-r--r-- | ssh.c | 32 |
3 files changed, 38 insertions, 10 deletions
@@ -39,6 +39,9 @@ | |||
39 | - markus@cvs.openbsd.org 2001/08/28 09:51:26 | 39 | - markus@cvs.openbsd.org 2001/08/28 09:51:26 |
40 | [readconf.c] | 40 | [readconf.c] |
41 | don't set DynamicForward unless Host matches | 41 | don't set DynamicForward unless Host matches |
42 | - markus@cvs.openbsd.org 2001/08/28 15:39:48 | ||
43 | [ssh.1 ssh.c] | ||
44 | allow: ssh -F configfile host | ||
42 | 45 | ||
43 | 20010815 | 46 | 20010815 |
44 | - (bal) Fixed stray code in readconf.c that went in by mistake. | 47 | - (bal) Fixed stray code in readconf.c that went in by mistake. |
@@ -6362,4 +6365,4 @@ | |||
6362 | - Wrote replacements for strlcpy and mkdtemp | 6365 | - Wrote replacements for strlcpy and mkdtemp |
6363 | - Released 1.0pre1 | 6366 | - Released 1.0pre1 |
6364 | 6367 | ||
6365 | $Id: ChangeLog,v 1.1496 2001/09/12 17:35:27 mouring Exp $ | 6368 | $Id: ChangeLog,v 1.1497 2001/09/12 17:48:04 mouring Exp $ |
@@ -34,7 +34,7 @@ | |||
34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
36 | .\" | 36 | .\" |
37 | .\" $OpenBSD: ssh.1,v 1.131 2001/08/22 17:45:16 stevesk Exp $ | 37 | .\" $OpenBSD: ssh.1,v 1.132 2001/08/28 15:39:48 markus Exp $ |
38 | .Dd September 25, 1999 | 38 | .Dd September 25, 1999 |
39 | .Dt SSH 1 | 39 | .Dt SSH 1 |
40 | .Os | 40 | .Os |
@@ -57,6 +57,7 @@ | |||
57 | .Op Fl m Ar mac_spec | 57 | .Op Fl m Ar mac_spec |
58 | .Op Fl o Ar option | 58 | .Op Fl o Ar option |
59 | .Op Fl p Ar port | 59 | .Op Fl p Ar port |
60 | .Op Fl F Ar configfile | ||
60 | .Oo Fl L Xo | 61 | .Oo Fl L Xo |
61 | .Sm off | 62 | .Sm off |
62 | .Ar port : | 63 | .Ar port : |
@@ -564,6 +565,14 @@ The default value can be set on a host-by-host basis in the | |||
564 | configuration files; see the | 565 | configuration files; see the |
565 | .Cm Compression | 566 | .Cm Compression |
566 | option below. | 567 | option below. |
568 | .It Fl F Ar configfile | ||
569 | Specifies an alternative per-user configuration file. | ||
570 | If a configuration file is given on the command line, | ||
571 | the system-wide configuration file | ||
572 | .Pq Pa /etc/ssh_config | ||
573 | will be ignored. | ||
574 | The default for the per-user configuration file is | ||
575 | .Pa $HOME/.ssh/config . | ||
567 | .It Fl L Ar port:host:hostport | 576 | .It Fl L Ar port:host:hostport |
568 | Specifies that the given port on the local (client) host is to be | 577 | Specifies that the given port on the local (client) host is to be |
569 | forwarded to the given host and port on the remote side. | 578 | forwarded to the given host and port on the remote side. |
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.138 2001/08/11 22:51:27 jakob Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.139 2001/08/28 15:39:48 markus Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -118,6 +118,9 @@ int fork_after_authentication_flag = 0; | |||
118 | */ | 118 | */ |
119 | Options options; | 119 | Options options; |
120 | 120 | ||
121 | /* optional user configfile */ | ||
122 | char *config = NULL; | ||
123 | |||
121 | /* | 124 | /* |
122 | * Name of the host we are connecting to. This is the name given on the | 125 | * Name of the host we are connecting to. This is the name given on the |
123 | * command line, or the HostName specified for the user-supplied name in a | 126 | * command line, or the HostName specified for the user-supplied name in a |
@@ -160,6 +163,8 @@ usage(void) | |||
160 | fprintf(stderr, "Options:\n"); | 163 | fprintf(stderr, "Options:\n"); |
161 | fprintf(stderr, " -l user Log in using this user name.\n"); | 164 | fprintf(stderr, " -l user Log in using this user name.\n"); |
162 | fprintf(stderr, " -n Redirect input from " _PATH_DEVNULL ".\n"); | 165 | fprintf(stderr, " -n Redirect input from " _PATH_DEVNULL ".\n"); |
166 | fprintf(stderr, " -F config Config file (default: ~/%s).\n", | ||
167 | _PATH_SSH_USER_CONFFILE); | ||
163 | fprintf(stderr, " -A Enable authentication agent forwarding.\n"); | 168 | fprintf(stderr, " -A Enable authentication agent forwarding.\n"); |
164 | fprintf(stderr, " -a Disable authentication agent forwarding (default).\n"); | 169 | fprintf(stderr, " -a Disable authentication agent forwarding (default).\n"); |
165 | #ifdef AFS | 170 | #ifdef AFS |
@@ -315,7 +320,7 @@ main(int ac, char **av) | |||
315 | 320 | ||
316 | again: | 321 | again: |
317 | while ((opt = getopt(ac, av, | 322 | while ((opt = getopt(ac, av, |
318 | "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:I:L:NPR:TVX")) != -1) { | 323 | "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) { |
319 | switch (opt) { | 324 | switch (opt) { |
320 | case '1': | 325 | case '1': |
321 | options.protocol = SSH_PROTO_1; | 326 | options.protocol = SSH_PROTO_1; |
@@ -525,6 +530,9 @@ again: | |||
525 | case 'b': | 530 | case 'b': |
526 | options.bind_address = optarg; | 531 | options.bind_address = optarg; |
527 | break; | 532 | break; |
533 | case 'F': | ||
534 | config = optarg; | ||
535 | break; | ||
528 | default: | 536 | default: |
529 | usage(); | 537 | usage(); |
530 | } | 538 | } |
@@ -609,12 +617,20 @@ again: | |||
609 | log_init(av[0], options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, | 617 | log_init(av[0], options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, |
610 | SYSLOG_FACILITY_USER, 1); | 618 | SYSLOG_FACILITY_USER, 1); |
611 | 619 | ||
612 | /* Read per-user configuration file. */ | 620 | /* |
613 | snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, _PATH_SSH_USER_CONFFILE); | 621 | * Read per-user configuration file. Ignore the system wide config |
614 | read_config_file(buf, host, &options); | 622 | * file if the user specifies a config file on the command line. |
615 | 623 | */ | |
616 | /* Read systemwide configuration file. */ | 624 | if (config != NULL) { |
617 | read_config_file(_PATH_HOST_CONFIG_FILE, host, &options); | 625 | read_config_file(config, host, &options); |
626 | } else { | ||
627 | snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, | ||
628 | _PATH_SSH_USER_CONFFILE); | ||
629 | |||
630 | /* Read systemwide configuration file. */ | ||
631 | read_config_file(_PATH_HOST_CONFIG_FILE, host, &options); | ||
632 | read_config_file(buf, host, &options); | ||
633 | } | ||
618 | 634 | ||
619 | /* Fill configuration defaults. */ | 635 | /* Fill configuration defaults. */ |
620 | fill_default_options(&options); | 636 | fill_default_options(&options); |