forward listens on port listen_port on your local machine. When it receives a connection, it forwards this to machine1 where a secure-mcserv(1) daemon is assumed to be running. The secure-mcserv daemon then makes a connection to machine2 on port port2. All traffic is then forwarded transparently between listen_port and port2 of machine2.
The --secure and --gzip options can be used to effect the connection between listen_port of the local machine and port2 of machine2. In this way forward can be used to create secure or compressed versions of any service.
Consider a print server A on some LAN. The LAN has a masquerading server B giving that LAN internet access. B can see both the internet and A. At some other site John has a machine D using a masquerading server C to give that LAN internet access. B and C can see each other only over the open internet. He would like to run lpr on D and have it automatically print out at A. He would also like the channel between B and C to be compressed and encrypted (using a 1024 bit key exchange).
The procedure is as follows (515 is the printer port): A# lpd & B# secure-mcserv -d -p 12345 add an entry to ~/.netrc for the password of john on B, then C# forward john@B:12345 A:515 515 --secure -K 1024 -z add an entry to /etc/printcap, defining a printer x on C, then D# lpr -Px mydocument
Consider Jill who doesn't like colleague John printing out screen dumps of her X session. She would like to create a secure X session between her X server A and her mainframe B.
The procedure is as follows (6010 corresponds to display 10.0): A# X & A# secure-mcserv -d -p 12345 add an entry to ~/.netrc for the password of jill on A, then B# forward jill@A:12345 A:6000 6010 --secure -K 1024 B# export DISPLAY=localhost:10.0 B# fvwm &
Out of bounds (MSG_OOB of recv(2) and send(2)) data is never encrypted or compressed. It is sent unmodified in the plain text. If anyone thinks this is a security risk, please tell me about it and I'll come up with something.
Screen resizing (detection?) under rlogin(1) does not seem to work, although it works under telnet(1). This must have something to do with OOB data not being sent properly. I don't feel like debugging rlogin, rlogind, forward, and secure-mcserv simultaneously to find the problem. If anyone wants to try this please go ahead.