How to make use of a terminal server
I have access to a terminal server where a modem pool is served.
Invokation of the modem is like the following,
telnet hostname portnum
Username: (type name and return)
Password: (type pass and return)
atdtphonenumber
I tried to use the following kermit script to automate the authentication,
#!/usr/local/bin/kermit
def myuserid username
def mypasswd password
set carrier-watch off
set host hostname portnum
for \%i 1 10 1 {
input 20 Username:
if success break
output \13
}
if > \%i 10 exit 1 No login prompt.
output \m(myuserid)\13
for \%j 1 10 1 {
input 10 Password:
if success break
output \13
{
if > \%j 10 exit No Password prompt.
output \m(mypasswd)\13
undef mypasswd
but password is always prompted interactively. My immediate purpose is
to use the dial command in the kermit script, how can I do it?
Jun
Re: How to make use of a terminal server
In article <gQHcb.483$z11.142@newssvr22.news.prodigy.com>,
Jun Zhang <nugulus@netscape.net> wrote:
: I have access to a terminal server where a modem pool is served.
: Invokation of the modem is like the following,
:
: telnet hostname portnum
: Username: (type name and return)
: Password: (type pass and return)
: atdtphonenumber
:
: I tried to use the following kermit script to automate the authentication,
:
: #!/usr/local/bin/kermit
: def myuserid username
: def mypasswd password
: set carrier-watch off
: set host hostname portnum
:
You need an "if failure" command here in case the connection fails.
: for \%i 1 10 1 {
: input 20 Username:
: if success break
: output \13
: }
: if > \%i 10 exit 1 No login prompt.
: output \m(myuserid)\13
:
: for \%j 1 10 1 {
: input 10 Password:
: if success break
: output \13
: {
:
That should be a right brace.
: if > \%j 10 exit No Password prompt.
: output \m(mypasswd)\13
: undef mypasswd
:
: but password is always prompted interactively. My immediate purpose is
: to use the dial command in the kermit script, how can I do it?
:
I don't understand what you mean by "password is always prompted
interactively". The password prompt is printed by the terminal server,
correct? Therefore "input 10 Password:" should see it and succeed, and
then the password will be sent by the "output \m(mypasswd)\13" command.
Are you saying that this is not happening?
Maybe you are using a secure version of C-Kermit and the terminal server
is requesting a secure form of authentication, which causes C-Kermit to
prompt for the password locally? To debug this, tell C-Kermit to "set
telnet debug on".
Anyway, after you have received the Password prompt and sent the password,
you can:
set modem type <name-of-modem>
dial <phone-number>
if fail (do something)
Also see:
[url]http://www.columbia.edu/kermit/ckermit80.html#x14[/url]
- Frank
Re: How to make use of a terminal server
Thanks a lot!
Jun
Frank da Cruz wrote:[color=blue]
> In article <gQHcb.483$z11.142@newssvr22.news.prodigy.com>,
> Jun Zhang <nugulus@netscape.net> wrote:
> : I have access to a terminal server where a modem pool is served.
> : Invokation of the modem is like the following,
> :
> : telnet hostname portnum
> : Username: (type name and return)
> : Password: (type pass and return)
> : atdtphonenumber
> :
> : I tried to use the following kermit script to automate the authentication,
> :
> : #!/usr/local/bin/kermit
> : def myuserid username
> : def mypasswd password
> : set carrier-watch off
> : set host hostname portnum
> :
> You need an "if failure" command here in case the connection fails.
>
> : for \%i 1 10 1 {
> : input 20 Username:
> : if success break
> : output \13
> : }
> : if > \%i 10 exit 1 No login prompt.
> : output \m(myuserid)\13
> :
> : for \%j 1 10 1 {
> : input 10 Password:
> : if success break
> : output \13
> : {
> :
> That should be a right brace.
>
> : if > \%j 10 exit No Password prompt.
> : output \m(mypasswd)\13
> : undef mypasswd
> :
> : but password is always prompted interactively. My immediate purpose is
> : to use the dial command in the kermit script, how can I do it?
> :
> I don't understand what you mean by "password is always prompted
> interactively". The password prompt is printed by the terminal server,
> correct? Therefore "input 10 Password:" should see it and succeed, and
> then the password will be sent by the "output \m(mypasswd)\13" command.
> Are you saying that this is not happening?
>
> Maybe you are using a secure version of C-Kermit and the terminal server
> is requesting a secure form of authentication, which causes C-Kermit to
> prompt for the password locally? To debug this, tell C-Kermit to "set
> telnet debug on".
>
> Anyway, after you have received the Password prompt and sent the password,
> you can:
>
> set modem type <name-of-modem>
> dial <phone-number>
> if fail (do something)
>
> Also see:
>
> [url]http://www.columbia.edu/kermit/ckermit80.html#x14[/url]
>
> - Frank[/color]