Telnet Scripting TFTP Updates
I know telent isn't the most secure protocol to be using but I have found a nifty telnet scripting tool available from:
http://users.telenet.be/tontonzen/gg/TST10.zip
I've just used it to update the firmware in 9 HP access points in around the same time it would take to do one via the web interface or cli manually.
At the moment I just changed the ip address at the head of the file and re-ran the shortcut for each one but I'm sure a list of hosts and a bit more tweaking maybe with a dash of vbscript could automate it even more.
The script I used for my HP Wap's is:
Code:
IP ADDRESS OF WAP 23
WAIT "Username:"
SEND "admin\m"
WAIT "Password:"
SEND "ADMIN PASSWORD\m"
WAIT "#"
SEND "copy tftp file\m"
WAIT ":"
SEND "1\m"
WAIT "name:"
SEND "hp420-2150.bin\m"
WAIT "IP:"
SEND "IP ADDRESS OF TFTP SERVER\m"
WAIT "[n]:"
SEND "n\m"
WAIT "#"
SEND "reset board\m"
WAIT "<y/n>:"
SEND "y\m"
Ben
Re: Telnet Scripting TFTP Updates
A) Use SSH. Telnet is vunerable to lots of fun attacks.
B) Code:
cat somecommands.txt | ssh user@somehost
Works for me and my Linux boxes.
Re: Telnet Scripting TFTP Updates
Yes Geoff as I said I am aware of telnets problems.
I'm looking for a scriptable commandline SSH client.
Thanks,
Ben
Re: Telnet Scripting TFTP Updates
Does 'cat' not work for you?
Re: Telnet Scripting TFTP Updates
I've now downloaded the SSHWindows install from http://sshwindows.sourceforge.net/download/ this gives me ssh via cygwin.
The nice think about the scripted telent was that it would wait for a specified response before continuing I'm not sure if just echoing a load of commands to an ssh session is going to be as successful.
Ben
Re: Telnet Scripting TFTP Updates
Well, both my client and server devices are Linux servers. So they don't paticularly care if you stuff a bunch of command down to them all at once. They'll just buffer up the input until they can run the next command. If I do want to do something fancy I can use the rather flexible bash shell to do most things complicated.
Re: Telnet Scripting TFTP Updates
@Geoff: cat somecommands.txt | ssh user@somehost just gives Pseudo-terminal will not be allocated because stdin is not a terminal.
Tried it ony a centos 4.4 box and also cygwin on windows.
Ben