advanced shell question (?)

Robert L Cochran cochranb at speakeasy.net
Sun Jan 30 23:09:35 UTC 2005


Why do you really need such a script? Why can't you just ssh into the 
computer and manually start a telnet session. If you don't need a script 
then don't bother with it.

But before you muck around with telnet -- are you sure that the network 
segment between the ssh-capable computer and the embedded boxes you wish 
to manage is itself secure from packet sniffers? Your login and password 
will be sent in cleartext. Anyone sniffing the network will be able to 
see it. Then when you are away from the embedded box, the script kiddies 
will play!

Bob Cochran

Jay Moore wrote:

>I have some embedded boxes that I need to manage remotely. They don't
>support ssh, only telnet is available. To address this security issue,
>my plan was to co-locate a "real" computer with the embedded devices so
>that I could ssh to the "real" computer, and then telnet from there over
>the local network to the embedded boxes.
>
>The way that I want to set this up is to create user accounts on the
>"real" computer that correspond to each of the embedded boxes. Then,
>when I log in as that user I want my shell configured to start a telnet
>session to the corresponding embedded box. 
>
>To test this idea I created a simple script as follows. It starts the
>telnet session, and gets me logged in - problem is that the script
>completes, and then the telnet session is gone. What I need then is some
>way to spawn an interactive shell from a shell script (I think). I've
>read that the "expect" program will handle such things, but I really
>prefer to do it using only the shell.
>
>#! /bin/sh
>
>    (sleep 3;
>    echo "password";
>    sleep 3;
>    echo "ls -la";
>    sleep 3;
>    ) | telnet -l user 192.168.0.2
>
>How do I do this (or can it be done at all)??
>
>Thanks,
>Jay
>
>  
>




More information about the users mailing list