diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-08 18:30:26 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-08 18:30:26 +0000 |
commit | 3bb4f9da7382e62dc08eb72ba8307c28d4ccc566 (patch) | |
tree | 543bfbb95923d8b21e28086d1d60641a8d4f8f28 /ssh.c | |
parent | 3fcf1a22b52ed8e66d2cf548d5d4528f67377af9 (diff) |
- markus@cvs.openbsd.org 2001/04/07 08:55:18
[buffer.c channels.c channels.h readconf.c ssh.c]
allow the ssh client act as a SOCKS4 proxy (dynamic local
portforwarding). work by Dan Kaminsky <dankamin@cisco.com> and me.
thanks to Dan for this great patch: use 'ssh -D 1080 host' and make
netscape use localhost:1080 as a socks proxy.
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.107 2001/04/06 21:00:13 markus Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.108 2001/04/07 08:55:18 markus Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -178,6 +178,9 @@ usage(void) | |||
178 | fprintf(stderr, " -R listen-port:host:port Forward remote port to local address\n"); | 178 | fprintf(stderr, " -R listen-port:host:port Forward remote port to local address\n"); |
179 | fprintf(stderr, " These cause %s to listen for connections on a port, and\n", __progname); | 179 | fprintf(stderr, " These cause %s to listen for connections on a port, and\n", __progname); |
180 | fprintf(stderr, " forward them to the other side by connecting to host:port.\n"); | 180 | fprintf(stderr, " forward them to the other side by connecting to host:port.\n"); |
181 | fprintf(stderr, " -D port Dynamically forward local port to multiple remote addresses.\n"); | ||
182 | fprintf(stderr, " Allows SSH to act as an application-layer proxy.\n"); | ||
183 | fprintf(stderr, " Protocols Supported: SOCKS4\n"); | ||
181 | fprintf(stderr, " -C Enable compression.\n"); | 184 | fprintf(stderr, " -C Enable compression.\n"); |
182 | fprintf(stderr, " -N Do not execute a shell or command.\n"); | 185 | fprintf(stderr, " -N Do not execute a shell or command.\n"); |
183 | fprintf(stderr, " -g Allow remote hosts to connect to forwarded ports.\n"); | 186 | fprintf(stderr, " -g Allow remote hosts to connect to forwarded ports.\n"); |
@@ -314,7 +317,7 @@ main(int ac, char **av) | |||
314 | opt = av[optind][1]; | 317 | opt = av[optind][1]; |
315 | if (!opt) | 318 | if (!opt) |
316 | usage(); | 319 | usage(); |
317 | if (strchr("eilcmpLRo", opt)) { /* options with arguments */ | 320 | if (strchr("eilcmpLRDo", opt)) { /* options with arguments */ |
318 | optarg = av[optind] + 2; | 321 | optarg = av[optind] + 2; |
319 | if (strcmp(optarg, "") == 0) { | 322 | if (strcmp(optarg, "") == 0) { |
320 | if (optind >= ac - 1) | 323 | if (optind >= ac - 1) |
@@ -480,6 +483,12 @@ main(int ac, char **av) | |||
480 | } | 483 | } |
481 | add_local_forward(&options, fwd_port, buf, fwd_host_port); | 484 | add_local_forward(&options, fwd_port, buf, fwd_host_port); |
482 | break; | 485 | break; |
486 | |||
487 | case 'D': | ||
488 | fwd_port = atoi(optarg); | ||
489 | add_local_forward(&options, fwd_port, "socks4", 0); | ||
490 | break; | ||
491 | |||
483 | case 'C': | 492 | case 'C': |
484 | options.compression = 1; | 493 | options.compression = 1; |
485 | break; | 494 | break; |