-\versionid $Id: config.but,v 1.21 2001/12/14 14:57:50 simon Exp $
+\versionid $Id: config.but,v 1.22 2001/12/15 12:15:24 simon Exp $
\C{config} Configuring PuTTY
To remove a port forwarding, simply select its details in the list
box, and click the \q{Remove} button.
+\S{config-ssh-portfwd-localhost} Controlling the visibility of
+forwarded ports
+
+\cfg{winhelp-topic}{ssh.tunnels.portfwd.localhost}
+
+The source port for a forwarded connection usually does not accept
+connections from any machine except the SSH client or server machine
+itself (for local and remote forwardings respectively). There are
+controls in the Tunnels panel to change this:
+
+\b The \q{Local ports accept connections from other hosts} option
+allows you to set up local-to-remote port forwardings in such a way
+that machines other than your client PC can connect to the forwarded
+port.
+
+\b The \q{Remote ports do the same} option does the same thing for
+remote-to-local port forwardings (so that machines other than the
+SSH server machine can connect to the forwarded port.) Note that
+this feature is only available in the SSH 2 protocol, and not all
+SSH 2 servers support it (OpenSSH 3.0 does not, for example).
+
\H{config-file} Storing configuration in a file
PuTTY does not currently support storing its configuration in a file
-\versionid $Id: using.but,v 1.4 2001/12/13 17:38:59 simon Exp $
+\versionid $Id: using.but,v 1.5 2001/12/15 12:15:24 simon Exp $
\C{using} Using PuTTY
number on the \e{server} (note that most servers will not allow you
to use port numbers under 1024 for this purpose).
+The source port for a forwarded connection usually does not accept
+connections from any machine except the SSH client or server machine
+itself (for local and remote forwardings respectively). There are
+controls in the Tunnels panel to change this:
+
+\b The \q{Local ports accept connections from other hosts} option
+allows you to set up local-to-remote port forwardings in such a way
+that machines other than your client PC can connect to the forwarded
+port.
+
+\b The \q{Remote ports do the same} option does the same thing for
+remote-to-local port forwardings (so that machines other than the
+SSH server machine can connect to the forwarded port.) Note that
+this feature is only available in the SSH 2 protocol, and not all
+SSH 2 servers support it (OpenSSH 3.0 does not, for example).
+
\H{using-rawprot} Making raw TCP connections
A lot of Internet protocols are composed of commands and responses
int x11_forward;
char x11_display[128];
/* port forwarding */
- int lport_acceptall; /* accepts connection from hosts other than localhost */
+ int lport_acceptall; /* accept conns from hosts other than localhost */
+ int rport_acceptall; /* same for remote forwarded ports (SSH2 only) */
char portfwd[1024]; /* [LR]localport\thost:port\000[LR]localport\thost:port\000\000 */
} Config;
write_setting_i(sesskey, "X11Forward", cfg->x11_forward);
write_setting_s(sesskey, "X11Display", cfg->x11_display);
write_setting_i(sesskey, "LocalPortAcceptAll", cfg->lport_acceptall);
+ write_setting_i(sesskey, "RemotePortAcceptAll", cfg->rport_acceptall);
{
char buf[2 * sizeof(cfg->portfwd)], *p, *q;
p = buf;
sizeof(cfg->x11_display));
gppi(sesskey, "LocalPortAcceptAll", 0, &cfg->lport_acceptall);
+ gppi(sesskey, "RemotePortAcceptAll", 0, &cfg->rport_acceptall);
{
char buf[2 * sizeof(cfg->portfwd)], *p, *q;
gpps(sesskey, "PortForwardings", "", buf, sizeof(buf));
ssh2_pkt_init(SSH2_MSG_GLOBAL_REQUEST);
ssh2_pkt_addstring("tcpip-forward");
ssh2_pkt_addbool(1);/* want reply */
- ssh2_pkt_addstring("127.0.0.1");
+ if (cfg.rport_acceptall)
+ ssh2_pkt_addstring("0.0.0.0");
+ else
+ ssh2_pkt_addstring("127.0.0.1");
ssh2_pkt_adduint32(sport);
ssh2_pkt_send();
IDC_X11_DISPSTATIC,
IDC_X11_DISPLAY,
IDC_LPORT_ALL,
+ IDC_RPORT_ALL,
IDC_PFWDSTATIC,
IDC_PFWDSTATIC2,
IDC_PFWDREMOVE,
case IDC_X11_DISPSTATIC:
case IDC_X11_DISPLAY:
return "JI(`',`ssh.tunnels.x11')";
- case IDC_LPORT_ALL:
case IDC_PFWDSTATIC:
case IDC_PFWDSTATIC2:
case IDC_PFWDREMOVE:
case IDC_PFWDLOCAL:
case IDC_PFWDREMOTE:
return "JI(`',`ssh.tunnels.portfwd')";
+ case IDC_LPORT_ALL:
+ case IDC_RPORT_ALL:
+ return "JI(`',`ssh.tunnels.portfwd.localhost')";
default:
return NULL;
SetDlgItemText(hwnd, IDC_X11_DISPLAY, cfg.x11_display);
CheckDlgButton(hwnd, IDC_LPORT_ALL, cfg.lport_acceptall);
+ CheckDlgButton(hwnd, IDC_RPORT_ALL, cfg.rport_acceptall);
CheckRadioButton(hwnd, IDC_PFWDLOCAL, IDC_PFWDREMOTE, IDC_PFWDLOCAL);
}
}
if (panel == tunnelspanelstart) {
- /* The Tunnels panel. Accelerators used: [acgo] deilmrstx */
+ /* The Tunnels panel. Accelerators used: [acgo] deilmrsthx */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
IDC_X11_DISPLAY, 50, NULL);
endbox(&cp);
beginbox(&cp, "Port forwarding", IDC_BOX_TUNNELS2);
- checkbox(&cp, "Local ports accept connections from o&ther hosts", IDC_LPORT_ALL);
+ checkbox(&cp, "Local ports accept connections from o&ther hosts",
+ IDC_LPORT_ALL);
+ checkbox(&cp, "Remote ports do t&he same (SSH v2 only)",
+ IDC_RPORT_ALL);
staticbtn(&cp, "Forwarded ports:", IDC_PFWDSTATIC,
"&Remove", IDC_PFWDREMOVE);
fwdsetter(&cp, IDC_PFWDLIST,
"Dest&ination", IDC_DPORTSTATIC, IDC_DPORTEDIT,
"A&dd", IDC_PFWDADD);
bareradioline(&cp, 2,
- "&Local", IDC_PFWDLOCAL, "Re&mote", IDC_PFWDREMOTE, NULL);
+ "&Local", IDC_PFWDLOCAL,
+ "Re&mote", IDC_PFWDREMOTE, NULL);
endbox(&cp);
}
case IDC_X11_FORWARD:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
- cfg.x11_forward =
- IsDlgButtonChecked(hwnd, IDC_X11_FORWARD);
+ cfg.x11_forward =
+ IsDlgButtonChecked(hwnd, IDC_X11_FORWARD);
break;
case IDC_LPORT_ALL:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
- cfg.lport_acceptall =
- IsDlgButtonChecked(hwnd, IDC_LPORT_ALL);
+ cfg.lport_acceptall =
+ IsDlgButtonChecked(hwnd, IDC_LPORT_ALL);
+ break;
+ case IDC_RPORT_ALL:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.rport_acceptall =
+ IsDlgButtonChecked(hwnd, IDC_RPORT_ALL);
break;
case IDC_X11_DISPLAY:
if (HIWORD(wParam) == EN_CHANGE)