Hacking Cyclades support into clogin

Andrew Pollock rancid-andrew at andrew.net.au
Tue Jan 27 01:33:20 UTC 2004


I give up, I can't grok TCL/Expect as well as I'd like, and therefore can't
hack the support into clogin that I'd like, so I'm going to explain here
what I'm trying to do in the hope that someone else who wants this
functionality (or some kind soul who knows the innards of clogin) can help
with the mechanics of the code (or help improve the logic).

Firstly, the Cyclades is configured so that going:

ssh -l andrew:router cyclades
or
ssh -l andrew:ttyS1 cyclades

will land you (after authenticating) on the console of the router connected
to port ttyS1 (where router has been defined as an alias for ttyS1).
Pressing Enter is required to get a console login spat out.
Sending a ~. on a newline after logging out of the console is required to
disconnect.

So I thought I'd create another method, instead of trying to hack the life
out of the existing ssh method, so I made a method called "cas" (console
access server), with caspassword and casuser variables.

I think this is where I've come unstuck, because the login procedure is only
passing a username and a userpassword, which aren't necessarily relevant to
the SSH connection to the Cyclades. The login procedure needs to be
recursive, in that it logs in once to the Cyclades using SSH, and then
presses Enter, and then handles a console login as it would normally (I
guess not unlike a telnet connection).

I haven't even made it to the logging out stage in clogin, but I guess if it
sees an "exit" or a "logout" or whatever, it needs to send an Enter and then
a ~.

Hope this helps someone with more TCL clue than I to get somewhere.

Andrew



More information about the Rancid-discuss mailing list