~/.netrc
List of machines and corresponding passwords.
Arbitrary socket forwarding over a secure or compressed channel
forward-socket [-h,
--help]
[-v,
--verbose]
[-V,
--version]
[-p,
--password
password]
[--netrc]
[--no-netrc]
[--secure]
[-z,
--gzip]
[-K,
--key-size
bits]
[user@]
machine1
[:port1]
machine2:port2
listen_port
forward-socket 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-socket can be used to create secure or compressed versions of any service.
All options are analogous to those of mirrordir. See mirrordir(1) for more info. --debug just prevents forward-socket from forking into the background as a daemon.
I havn't tested this, but they seem logical. Tell me if I've made a typo somewhere.
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-socket 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-socket jill@A:12345 A:6000 6010 --secure -K 1024
B# export DISPLAY=localhost:10.0
B# fvwm &
Telnet logins, X sessions, printer (lpr) services, http and pop3 connections have been tested and work. Ftp connections do not forward because of the way ftp tries to do wierd binding things with sockets (?). Please tell about what else worked, although most everything should work.
~/.netrc
List of machines and corresponding passwords.
Unchanged in 5 releases since Debian 2.2 (Potato).