ssh -R option

Kenneth J Baker bakerkj at umich.edu
Tue Jun 13 01:58:28 EST 2000


Dear list,

I'm relatively new to using ssh.  I'm trying to use the -R option to set
up a forwarded port between two machines.  Specifically I'd like to be
able to ssh to machineB from machineA and then have a port on machineB
that I can connect to machineA with.  If my understanding is correct I'd
need a command like:
	machineA>	ssh -R 10000:machineA:23 machineB
This should open port 10000 on machineB to be forwarded to machineA:23,
right?  Assuming I have telnet open on machineA I should be able to then:
	machineB>	telnet machineB 10000

For some reason this doesn't work.  Is what i'm trying to do possible?
Any suggestions?

Thanks,
Ken


(below is the debug output when I run the above command with the -v option)

[root at machineA /root]# ssh -v -R 10000:machineA:23 machineB
SSH Version OpenSSH-2.1, protocol versions 1.5/2.0.
Compiled with SSL (0x0090581f).
debug: Reading configuration data /etc/ssh/ssh_config
debug: Applying options for *
debug: Seeding random number generator
debug: ssh_connect: getuid 0 geteuid 0 anon 0
debug: Connecting to machineB [192.168.1.20] port 22.
debug: Seeding random number generator
debug: Allocated local port 824.
debug: Connection established.
debug: Remote protocol version 1.99, remote software version OpenSSH-2.1
debug: Local version string SSH-1.5-OpenSSH-2.1
debug: Waiting for server public key.
debug: Received server public key (768 bits) and host key (1024 bits).
debug: Host 'machineB' is known and matches the RSA host key.
debug: Seeding random number generator
debug: Encryption type: 3des
debug: Sent encrypted session key.
debug: Installing crc compensation attack detector.
debug: Received encrypted confirmation.
debug: Trying RSA authentication with key 'root at machineA'
debug: Received RSA challenge from server.
debug: Sending response to host key RSA challenge.
debug: Remote: RSA authentication accepted.
debug: RSA authentication accepted by server.
debug: Requesting pty.
debug: Connections to remote port 10000 forwarded to local address machineA:23
debug: Requesting shell.
debug: Entering interactive session.
[root at machineB /root]#

........

[root at machineB /root]# telnet machineB 10000
Trying 192.168.1.20...
telnet: Unable to connect to remote host: Connection refused









More information about the openssh-unix-dev mailing list