954,234 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Telnet and Apple Script

Hi Folks, hope this is in the right section.

I need to Telnet to a machine from OSX, the machine is a linux box, when i do this from the terminal (or iterm) it connects but prompts me immediately with "password", it seems to be skipping the "logon" bit, but if i hit return it then prompts me for my login then password and i can get in. I have been playing with Applescripts with the telnet command and the terminal but still cant get it to go right. What i need to do is add a carriage return in when it prompts me for the password, this would then take me to the logon bit which i need. how does one do this in applescript??

Bit long winded i know but there you go! Any help would be really helpful.

gn0m3

gn0m3
Junior Poster in Training
67 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

Hello,

There's an easier way. Simply use -l username as a command-line argument to telnet when you start it. See man telnet for more information.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

thanks for the advice, in the end i created a small apple script which sorted it right out. will put below in case anyone else has this issue!

set telnet to "telnet -K ip address"
tell application "Terminal"
run
do script telnet
delay 1
end tell

gn0m3
Junior Poster in Training
67 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

I would like to Telnet data to and from an ethernet device, as well as command which iTune song to play based on this data. Is this all possible from within an apple script?

How do you loop in apple script? I'd like to have the script loop waiting for Telnet data from the device. When it meets certain criteria I'd like to execute another part of the script. Possible?

99bobster99
Newbie Poster
1 post since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: