: I am trying to tunnel through a firewall where I have a telnet account
: set up. The firewall will not allow me to use ssh.
:
: Let's assume three machines:
: INTERNAL -- inside the firewall
: FIREWALL -- yes, the firewall machine
: EXTERNAL -- the machine in the real internet that has full access
:
: If I do things manually with an expect script, I can let logged into
: my shell account on EXTERNAL without any problems. It goes like this:
: send telnet
: expect username
: send myname
: expect password
: send mypassword1
: expect computername
: send telnet EXTERNAL
: expect pasword
: send mypassword2
: expect computername
: send ppp-command
: interact
:
: This isn't a correct expect script, but it shows what I'm trying to
: do.
:
: I've tried pppd pty 'expect .....' with no luck I'm beginning to
: wonder if the FIREWALL telnet is eight bit clean. I can't send it any
: parms when I launch from there. Is there any way to encode a ppp
: session into a 7 bit conversation, like uuencode?
:
: Also, it's not clear if I can use expect in this manner. Obviously a
: chat script won't work ... unless I'm missing something.
:
Remove variables and unknowns. Try replacing Expect and Telnet with
C-Kermit:
http://www.columbia.edu/kermit/ckermit.html
which (a) can be automated directly, rather than indirectly by a separate
program; (b) can be told to make 8-bit-clean 100% transparent connections;
and (c) yet nevertheless knows that when it is a Telnet client that it must
quote IACs. Scripting examples:
http://www.columbia.edu/kermit/ckscripts.html
A somewhat related article on using C-Kermit as your PPP dialer:
http://www.columbia.edu/kermit/case13.html
The commands for telling C-Kermit to make a 100%-transparent Telnet
connection are:
eightbit ; 8-bit clean
set terminal escape disabled ; No escape character
set host xxxx ; (replace by hostname)
if fail exit 1
And then rest of your script is about the same, except replace
"expect" with input <n> (where <n> is the number of seconds to wait
before timing out and failing) and "send" with "output" or "lineout":
input 10 username
if fail exit 1 No username prompt
lineout myname ; (or use a variable here)
input 5 password
lineout mypassword1 ; (but don't put passwords in files!)
etc.
- Frank