Thanks I really appreciate it. Yes thats precisly what I am doing. I am
allowing access to a terminal server (into a router lab) using radius to
ensure the user is only using time during there alloted timeslot. But I
don't beleive that IOS will listen to a reply attribute that will
automagically disconnect the users vty when there time is
up........perhaps this exists though. so I was just going to cron an rsh
that resets all vtys.
Thanks again
Brian
On Sat, 16 Mar 2002, C. Jon Larsen wrote:
>
> This perl code that opens a pipe to an rsh subprocess that I wrote has
> been working for over a year. It clears a cisco tty, which requires a
> confirm. I think this is exactly the situation that is described. I
> simply sleep, and then send "\n".
>
> You'll need to replace the hash elements $cs->{'host'} and
> $cs->{'command'} with the host and the rsh command to run, respectively.
> You may also need to tune the sleep value.
>
> $SLEEP = 2;
>
> sub clearCiscoTty {
>
> my $cs = shift || return '';
> my $command = qq{/usr/bin/rsh $cs->{'host'} "$cs->{'command'}"};
> $lockFile->log("command: $command");
>
> # Open a pipe to the command to read STDOUT and STDERR:
> unless ( open( REXEC, "| $command 1> /dev/null" ) ) {
> $lockFile->log("Open to run command failed !");
> return -1;
> }
>
> sleep $SLEEP;
> print REXEC "\n";
> sleep $SLEEP;
> close(REXEC);
> }
>
>
>
> On Sat, 16 Mar 2002, Niels Bakker wrote:
>
> > >> On Sat, Mar 16, 2002 at 01:05:56AM -0600, Brian wrote:
> > >>> Is there a way I can "answer" this and let the router know "yes"?
> > >>> I know that with SNMP or telnet scripting this is easier, but surely
> > >>> there exists a way via RSH to just send the router a postive or
> > >>> negative response to a y/n question.
> >
> > > On Sat, 16 Mar 2002, Gert Doering wrote:
> > >> Try "echo yes | rsh ..."
> >
> > * signal@shreve.net (Brian) [Sat 16 Mar 2002, 18:30 CET]:
> > > That doesn't appear to work. I even tried using like "echo -e yes \r\n"
> > > (and other combinations thereof). It hangs at the confirm prompt, I have
> > > to suspend the process then kill it off.
> >
> > rsh reads from its tty, not from stdin. You can work around this by
> > using a program called `pty'; it opens a pseudo tty and runs the program
> > given on its command line on it. The source comes with Stevens' book
> > _Advanced Programming in the Unix Environment_. Unfortunately I don't
> > have my modified rsh anymore that worked on Solaris, as the stock rsh on
> > at least 2.6 had some quirks that prevented it from functioning.
> >
> > Disclaimer: the above is all from memory, and it's been a while since
> > I last had to do this. The major problem I had to solve was rsh not
> > wanting to run without a pty (i.e., from cron).
> >
> > Good luck,
> >
> >
> > -- Niels.
> >
>
> --
>
> C. Jon Larsen Chief Technology Officer, Richweb.com (804.307.6939)
> SMTP: jlarsen@richweb.com (http://richweb.com/cjl_pgp_pub_key.txt)
>
> Richweb.com:
> Designing Open Source Internet Business Solutions since 1995
> Building Safe, Secure, Reliable Cisco-Powered Networks since 1995
>
>
-----------------------------------------------
Brian Feeny, CCIE #8036 e: signal@shreve.net
Network Engineer p: 318.222.2638x109
ShreveNet Inc. f: 318.221.6612
This archive was generated by hypermail 2b29 : Sun Aug 04 2002 - 04:13:38 EDT