Ok, so I am a procomm lover, and the powers that be here locked down all telnet access and no we can only use SSH
So, I started up a script to telnet into a local server and then SSH from there.. I have not put much time at all into it, so currently the script just pops up an input dialog box to insert a manual ip for the end device, telnets and logs into the server, then SSH's to the ip that was input and logs in.. Works fine, but I would like to see if I can set something up where I just hit a connection in the connection directory and it goes out and does the functions of the script automatically.. Or something to that effect. Basically, I would rather not have to manually put in an IP address lol... Any input would be appreciated
Here is the wimpy stuff that I have written so far. Server and route usernames, IP's and passwords have been changed in here for obvious reasons. They are static in the script so my replacements should not be looked on as variables...
string RouterIP,RouterTelnet
integer Event,QuitCheckbox
proc main
dialogbox 0 81 22 244 87 2 "Router Selection"
editbox 8 70 20 110 11 RouterIP
pushbutton 1 68 48 40 13 "Go!!!!!" DEFAULT
checkbox 150 132 49 42 11 "Quit" QuitCheckbox
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 0 ; No event occurred.
endcase
case 1 ; Button was pressed.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy dialog box.
strfmt RouterTelnet "ssh -l routeruname %s^M" RouterIP
CONNECTMANUAL TELNET "Server ip x.x.x.x"
waitfor "login: "
transmit "serveruname^M"
waitfor "Password: "
transmit "serverpw^M"
waitfor "[dmelle@server1 ~]$ "
transmit RouterTelnet
waitfor "password: "
transmit "routerpw^M"
endproc
So, I started up a script to telnet into a local server and then SSH from there.. I have not put much time at all into it, so currently the script just pops up an input dialog box to insert a manual ip for the end device, telnets and logs into the server, then SSH's to the ip that was input and logs in.. Works fine, but I would like to see if I can set something up where I just hit a connection in the connection directory and it goes out and does the functions of the script automatically.. Or something to that effect. Basically, I would rather not have to manually put in an IP address lol... Any input would be appreciated
Here is the wimpy stuff that I have written so far. Server and route usernames, IP's and passwords have been changed in here for obvious reasons. They are static in the script so my replacements should not be looked on as variables...
string RouterIP,RouterTelnet
integer Event,QuitCheckbox
proc main
dialogbox 0 81 22 244 87 2 "Router Selection"
editbox 8 70 20 110 11 RouterIP
pushbutton 1 68 48 40 13 "Go!!!!!" DEFAULT
checkbox 150 132 49 42 11 "Quit" QuitCheckbox
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 0 ; No event occurred.
endcase
case 1 ; Button was pressed.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy dialog box.
strfmt RouterTelnet "ssh -l routeruname %s^M" RouterIP
CONNECTMANUAL TELNET "Server ip x.x.x.x"
waitfor "login: "
transmit "serveruname^M"
waitfor "Password: "
transmit "serverpw^M"
waitfor "[dmelle@server1 ~]$ "
transmit RouterTelnet
waitfor "password: "
transmit "routerpw^M"
endproc